PluginProbe
Chartify – WordPress Chart Plugin / 3.3.9
Chartify – WordPress Chart Plugin v3.3.9
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.3.9, at admin/class-chart-builder-admin.php

7,912 lines 570.0 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 ) );
209
210 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderChartSettings', array(
211 'types' => CBFunctions()->getAllowedTypes(),
212 'max_selected_options' => 2,
213 'l10n' => array(
214 'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', "chart-builder" ),
215 'loading' => esc_html__( 'Loading...', "chart-builder" ),
216 'filter_config_error' => esc_html__( 'Please check the filters you have configured.', "chart-builder" ),
217 'select_columns' => esc_html__( 'Please select a few columns to include in the chart.', "chart-builder" ),
218 '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" ),
219 ),
220 'ajax' => array(
221 'url' => admin_url( 'admin-ajax.php' ),
222 'nonces' => array(
223 'filter_get_props' => wp_create_nonce( 'cbuilder-fetch-post-type-props' ),
224 'filter_get_data' => wp_create_nonce( 'cbuilder-fetch-post-type-data' ),
225 'quiz_maker_get_data' => wp_create_nonce( 'cbuilder-fetch-quiz-maker-data' ),
226 'quiz_maker_save_data' => wp_create_nonce( 'cbuilder-save-quiz-maker-data' ),
227 'author_user_search' => wp_create_nonce( 'cbuilder-author-user-search' ),
228
229 ),
230 'actions' => array(
231 'filter_get_props' => 'fetch_post_type_props',
232 'filter_get_data' => 'fetch_post_type_data',
233 'quiz_maker_get_data' => 'fetch_quiz_maker_data',
234 'quiz_maker_save_data' => 'save_quiz_maker_data',
235 'author_user_search' => 'author_user_search'
236 ),
237 ),
238 'db_query' => array(
239 'tables' => $table_col_mapping,
240 ),
241 ) );
242
243 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 );
244 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 );
245 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 );
246 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 );
247
248 if ( false !== strpos( $hook_suffix, 'settings' ) ) {
249 wp_enqueue_script( $this->plugin_name . '-settings', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-settings.js', array( 'jquery' ), $this->version, true );
250
251 wp_localize_script( $this->plugin_name . '-settings', 'aysChartBuilderAdminSettings', array(
252 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
253 'selectUserRoles' => __( 'Select user roles', 'chart-builder' ),
254 'delete' => __( 'Delete', 'chart-builder' ),
255 'selectQuestionDefaultType' => __( 'Select question default type', 'chart-builder' ),
256 'yes' => __( 'Yes', 'chart-builder' ),
257 'cancel' => __( 'Cancel', 'chart-builder' ),
258 'somethingWentWrong' => __( "Maybe something went wrong.", 'chart-builder' ),
259 'failed' => __( 'Failed', 'chart-builder' ),
260 'selectPage' => __( 'Select page', 'chart-builder' ),
261 'selectPostType' => __( 'Select post type', 'chart-builder' ),
262 'copied' => __( 'Copied!', 'chart-builder'),
263 'clickForCopy' => __( 'Click to copy', 'chart-builder'),
264 'selectForm' => __( 'Select form', 'chart-builder'),
265 ) );
266 }
267 }
268
269 /**
270 * De-register JavaScript files for the admin area.
271 *
272 * @since 1.0.0
273 */
274 public function disable_scripts($hook_suffix) {
275 if (false !== strpos($hook_suffix, $this->plugin_name)) {
276 if (is_plugin_active('ai-engine/ai-engine.php')) {
277 wp_deregister_script('mwai');
278 wp_deregister_script('mwai-vendor');
279 wp_dequeue_script('mwai');
280 wp_dequeue_script('mwai-vendor');
281 }
282
283 if (is_plugin_active('html5-video-player/html5-video-player.php')) {
284 wp_dequeue_style('h5vp-admin');
285 wp_dequeue_style('fs_common');
286 }
287
288 if (is_plugin_active('panorama/panorama.php')) {
289 wp_dequeue_style('bppiv_admin_custom_css');
290 wp_dequeue_style('bppiv-custom-style');
291 }
292
293 }
294 }
295
296 /**
297 * Register the administration menu for this plugin into the WordPress Dashboard menu.
298 *
299 * @since 1.0.0
300 */
301 public function add_plugin_admin_menu(){
302
303 /*
304 * Add a settings page for this plugin to the Settings menu.
305 *
306 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
307 *
308 * Administration Menus: http://codex.wordpress.org/Administration_Menus
309 *
310 */
311 global $wpdb;
312 $menu_item = __( 'Chart Builder', "chart-builder" );
313 $this->capability = 'manage_options';
314
315 add_menu_page(
316 __( 'Chart Builder', "chart-builder" ),
317 $menu_item,
318 $this->capability,
319 $this->plugin_name,
320 array($this, 'display_plugin_charts_page'),
321 CHART_BUILDER_ADMIN_URL . '/images/icons/ays_chart_logo_icon_bw.svg',
322 '6.22'
323 );
324
325 }
326
327 public function add_plugin_charts_submenu(){
328 $hook_page_view = add_submenu_page(
329 $this->plugin_name,
330 __('All Charts', 'chart-builder'),
331 __('All Charts', 'chart-builder'),
332 'manage_options',
333 $this->plugin_name,
334 array($this, 'display_plugin_charts_page')
335 );
336
337 add_action( "load-$hook_page_view", array( $this, 'screen_option_charts' ) );
338 }
339
340 public function add_plugin_add_new_submenu(){
341 $hook_charts = add_submenu_page(
342 $this->plugin_name,
343 __('Add New', 'chart-builder'),
344 __('Add New', 'chart-builder'),
345 'manage_options',
346 $this->plugin_name."&action=add",
347 array($this, 'display_plugin_addnew_page')
348 );
349 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
350 }
351
352 public function add_plugin_dashboard_submenu(){
353 $hook_charts = add_submenu_page(
354 $this->plugin_name,
355 __('How to use', 'chart-builder'),
356 __('How to use', 'chart-builder'),
357 'manage_options',
358 $this->plugin_name . '-dashboard',
359 array($this, 'display_plugin_setup_page')
360 );
361 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
362 }
363
364 public function add_plugin_general_settings_submenu(){
365 $hook_settings = add_submenu_page( $this->plugin_name,
366 __('General Settings', 'chart-builder'),
367 __('General Settings', 'chart-builder'),
368 'manage_options',
369 $this->plugin_name . '-settings',
370 array($this, 'display_plugin_settings_page')
371 );
372 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
373 }
374
375 public function add_plugin_featured_plugins_submenu(){
376 $hook_our_products = add_submenu_page( $this->plugin_name,
377 __('Our products', 'chart-builder'),
378 __('Our products', 'chart-builder'),
379 'manage_options',
380 $this->plugin_name . '-featured-plugins',
381 array($this, 'display_plugin_featured_plugins_page')
382 );
383
384 add_action("load-$hook_our_products", array( $this, 'add_tabs' ));
385 }
386
387 public function add_plugin_chart_features_submenu(){
388 $hook_pro_features = add_submenu_page(
389 $this->plugin_name,
390 __('PRO Features', 'chart-builder'),
391 __('PRO Features', 'chart-builder'),
392 'manage_options',
393 $this->plugin_name . '-chart-features',
394 array($this, 'display_plugin_chart_features_page')
395 );
396
397 add_action("load-$hook_pro_features", array( $this, 'add_tabs' ));
398 }
399
400 public function screen_option_charts(){
401 $option = 'per_page';
402 $args = array(
403 'label' => __('Charts', "chart-builder"),
404 'default' => 5,
405 'option' => 'cb_charts_per_page'
406 );
407
408 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
409 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
410 add_screen_option( $option, $args );
411 }
412
413 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
414 }
415
416 public function screen_option_settings(){
417 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
418 }
419
420 public function add_tabs() {
421 $screen = get_current_screen();
422
423 if ( ! $screen) {
424 return;
425 }
426 }
427
428 public function display_plugin_charts_page(){
429 global $ays_chart_db_actions;
430
431 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
432 $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
433 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
434 $id = (isset($_GET['id'])) ? absint( wp_unslash( $_GET['id'] ) ) : 0;
435 if (isset($_POST['bulk_delete_confirm'])) {
436 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
437 $ids = wp_unslash( $_POST['bulk-delete'] );
438 $ids = array_map( 'absint', (array) $ids );
439 foreach ($ids as $id) {
440 if ($id > 0) {
441 $this->db_obj->delete_item( $id );
442 }
443 }
444 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
445 $url = esc_url_raw( add_query_arg( array(
446 "status" => 'all-deleted'
447 ), $url ) );
448 wp_redirect( $url );
449 exit;
450 }
451 }
452
453 switch ($action) {
454 case 'trash':
455 if( $id > 0 ){
456 $this->db_obj->trash_item( $id );
457 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
458 $url = esc_url_raw( add_query_arg( array(
459 "status" => 'trashed'
460 ), $url ) );
461 wp_redirect( $url );
462 exit;
463 }
464 break;
465 case 'restore':
466 if( $id > 0 ){
467 $this->db_obj->restore_item( $id );
468 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
469 $url = esc_url_raw( add_query_arg( array(
470 "status" => 'restored'
471 ), $url ) );
472 wp_redirect( $url );
473 exit;
474 }
475 break;
476 case 'delete':
477 if( $id > 0 ){
478 $this->db_obj->delete_item( $id );
479 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
480 $url = esc_url_raw( add_query_arg( array(
481 "status" => 'deleted'
482 ), $url ) );
483 wp_redirect( $url );
484 exit;
485 }
486 break;
487 case 'publish':
488 if( $id > 0 ){
489 $this->db_obj->publish_item( $id );
490 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
491 $url = esc_url_raw( add_query_arg( array(
492 "status" => 'published'
493 ), $url ) );
494 wp_redirect( $url );
495 exit;
496 }
497 break;
498 case 'unpublish':
499 if( $id > 0 ){
500 $this->db_obj->restore_item( $id );
501 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
502 $url = esc_url_raw( add_query_arg( array(
503 "status" => 'unpublished'
504 ), $url ) );
505 wp_redirect( $url );
506 exit;
507 }
508 break;
509 case 'duplicate':
510 if( $id > 0 ){
511 $this->db_obj->duplicate_item( $id );
512 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
513 $url = esc_url_raw( add_query_arg( array(
514 "status" => 'duplicated'
515 ), $url ) );
516 wp_redirect( $url );
517 exit;
518 }
519 break;
520 case 'add':
521 include_once('partials/charts/actions/chart-builder-charts-actions.php');
522 break;
523 case 'edit':
524 include_once('partials/charts/actions/chart-builder-charts-actions.php');
525 break;
526 default:
527 include_once('partials/charts/chart-builder-charts-display.php');
528 }
529 }
530 public static function chart_builder_svg_sanitize_allowed_properties(){
531
532 $allowed_properties = array(
533 'div' => array(
534 'id' => true,
535 'class' => true,
536 'style' => true,
537 ),
538 'svg' => array(
539 'class' => true,
540 'version' => true,
541 'overflow' => true,
542 'preserveAspectRatio' => true,
543 'preserveaspectratio' => true,
544 'fill' => true,
545 'viewBox' => true,
546 'viewbox' => true,
547 'height' => true,
548 'width' => true,
549 'xmlns' => true,
550 'xmlns:xlink' => true,
551 'id' => true,
552 'title' => true,
553 ),
554 'g' => array(
555 'id' => true,
556 'class' => true,
557 'stroke-width' => true,
558 'stroke-linecap' => true,
559 'stroke-linejoin' => true,
560 ),
561 'path' => array(
562 'id' => true,
563 'class' => true,
564 'd' => true,
565 'fill' => true,
566 'vector-effect' => true,
567 'xmlns:default' => true,
568 ),
569 'span' => array(
570 'class' => true,
571 ),
572 'img' => array(
573 'src' => true,
574 'alt' => true,
575 ),
576 );
577
578 return $allowed_properties;
579 }
580
581 public static function get_allowed_tags_for_loader() {
582 return array(
583 'span' => array('class' => array()),
584 'img' => array('src' => array(), 'alt' => array()),
585 );
586 }
587
588 public function display_plugin_setup_page(){
589 include_once('partials/chart-builder-admin-display.php');
590 }
591
592 public function display_plugin_addnew_page(){
593
594 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
595 // $url = esc_url_raw( add_query_arg( array(
596 // "action" => 'add'
597 // ), $url ) );
598 // wp_redirect( $url );
599 }
600
601 public function display_plugin_settings_page(){
602 include_once('partials/settings/chart-builder-settings.php');
603 }
604
605 public function display_plugin_featured_plugins_page(){
606 include_once('partials/features/chart-builder-plugin-featured-display.php');
607 }
608
609 public function display_plugin_chart_features_page(){
610 include_once('partials/features/chart-builder-features-display.php');
611 }
612
613 /**
614 * Add settings action link to the plugins page.
615 *
616 * @since 1.0.0
617 */
618 public function add_action_links( $links ){
619
620 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
621
622 /*
623 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
624 */
625 $settings_link = array(
626 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
627 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
628 // '<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>',
629 '<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>
630 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
631 );
632 return array_merge( $settings_link, $links );
633
634 }
635
636
637 public static function set_screen($status, $option, $value){
638 return $value;
639 }
640
641 public function ays_admin_ajax(){
642 global $wpdb;
643
644 $response = array(
645 "status" => false
646 );
647 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
648 $function = isset( $_REQUEST['function'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['function'] ) ) : null;
649
650 if($function !== null){
651 $response = array();
652 if( is_callable( array( $this, $function ) ) ){
653 $response = $this->$function();
654
655 ob_end_clean();
656 $ob_get_clean = ob_get_clean();
657 echo json_encode( $response );
658 wp_die();
659 }
660
661 }
662
663 ob_end_clean();
664 $ob_get_clean = ob_get_clean();
665 echo json_encode( $response );
666 wp_die();
667 }
668
669 public function deactivate_plugin_option(){
670 // Run a security check.
671 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
672 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
673 } else {
674 wp_die();
675 }
676
677 // Check for permissions.
678 if ( ! current_user_can( 'manage_options' ) ) {
679 ob_end_clean();
680 $ob_get_clean = ob_get_clean();
681 echo json_encode(array(
682 'option' => ''
683 ));
684 wp_die();
685 }
686
687 if( is_user_logged_in() ) {
688 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['upgrade_plugin'] ) ) : '';
689 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
690
691 if ( $upgrade_option === '' ) {
692 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
693 } else {
694 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
695 }
696
697 $response = array(
698 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
699 );
700
701 wp_send_json_success( $response );
702 } else {
703 ob_end_clean();
704 $ob_get_clean = ob_get_clean();
705 echo json_encode(array(
706 'option' => ''
707 ));
708 wp_die();
709 }
710 }
711
712 public function chart_builder_admin_footer($a){
713 if(isset($_REQUEST['page'])){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
714 if(false !== strpos( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ), $this->plugin_name)){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
715 ?>
716 <div class="ays-chart-footer-support-box">
717 <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>
718 <span class="ays-chart-footer-slash-row">/</span>
719 <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>
720 <span class="ays-chart-footer-slash-row">/</span>
721 <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>
722 </div>
723 <p style="font-size:13px;text-align:center;font-style:italic;">
724 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
725 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
726 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
727 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
728 </p>
729 <?php
730 }
731 }
732 }
733
734 // Chart Builder Elementor widget init
735 public function chart_builder_el_widgets_registered() {
736 // We check if the Elementor plugin has been installed / activated.
737 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
738 // get our own widgets up and running:
739 // copied from widgets-manager.php
740 if ( class_exists( 'Elementor\Plugin' ) ) {
741 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
742 $elementor = Elementor\Plugin::instance();
743 if ( isset( $elementor->widgets_manager ) ) {
744 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
745 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
746 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
747 $template_file = locate_template( $widget_file );
748 if ( !$template_file || !is_readable( $template_file ) ) {
749 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
750 }
751 if ( $template_file && is_readable( $template_file ) ) {
752 require_once $template_file;
753 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
754 }
755 }
756 }
757 }
758 }
759 }
760 }
761
762 public function fetch_post_type_props(){
763 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
764 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'cbuilder-fetch-post-type-props' ) : '';
765 if ( $nonce ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
766 $results = isset($_POST['post_type']) ? CBFunctions()->get_post_type_properties( sanitize_text_field( wp_unslash($_POST['post_type']) ) ) : '';
767
768 return array(
769 'success' => true,
770 'fields' => $results,
771 );
772 }
773
774 return array(
775 'success' => false,
776 );
777 }
778
779 public static function get_max_id( $table ) {
780 global $wpdb;
781 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
782
783 $sql = "SELECT MAX(id) FROM {$db_table}";
784
785 $result = intval( $wpdb->get_var( $sql ) );
786
787 return $result;
788 }
789
790 public static function ays_restriction_string($type, $x, $length){
791 $output = "";
792 switch($type){
793 case "char":
794 if(strlen($x)<=$length){
795 $output = $x;
796 } else {
797 $output = substr($x,0,$length) . '...';
798 }
799 break;
800 case "word":
801 $res = explode(" ", $x);
802 if(count($res)<=$length){
803 $output = implode(" ",$res);
804 } else {
805 $res = array_slice($res,0,$length);
806 $output = implode(" ",$res) . '...';
807 }
808 break;
809 }
810 return $output;
811 }
812
813 public function ays_chart_sale_banner(){
814 // 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' )) {
815 // update_option('ays_chart_sale_btn', 1);
816 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
817 // }
818
819 $ays_chart_sale_date = get_option('ays_chart_sale_date');
820
821 $val = 60*60*24*5;
822
823 $current_date = current_time( 'mysql' );
824 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
825
826 $days_diff = $date_diff / $val;
827
828 if(intval($days_diff) > 0 ){
829 update_option('ays_chart_sale_btn', 0);
830 }
831
832 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
833 if( $ays_chart_builder_flag == 0 ){
834 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
835 if ( isset( $_GET['page'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), CHART_BUILDER_NAME ) !== false ) {
836 if( !(Chart_Builder_Admin::get_max_id('charts') <= 1) ){
837 // $this->ays_chart_sale_message_30_emma($ays_chart_builder_flag);
838 $this->ays_chart_new_silver_bundle_message_2025($ays_chart_builder_flag);
839 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
840 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
841 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
842 // $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
843 // $this->ays_chart_christmas_message_2024($ays_chart_builder_flag);
844 }
845 }
846 }
847 }
848
849 public function ays_chart_dismiss_button(){
850
851 $data = array(
852 'status' => false,
853 );
854
855 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
856 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' ) ) {
857 update_option('ays_chart_sale_btn', 1);
858 update_option('ays_chart_sale_date', current_time( 'mysql' ));
859 $data['status'] = true;
860 }
861 }
862
863 ob_end_clean();
864 $ob_get_clean = ob_get_clean();
865 echo json_encode($data);
866 wp_die();
867
868 }
869
870 // 30% Sale Emma
871 public function ays_chart_sale_message_30_emma($ishmar){
872 if($ishmar == 0 ){
873 $content = array();
874 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
875 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
876
877 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
878 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
879
880 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
881 $content[] = '<div>
882 <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;">
883 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
884 </div>';
885 $content[] = '</div>';
886
887 $content[] = '<div style="font-size: 17px;">';
888 $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
889 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
890
891 $content[] = '</div>';
892
893
894
895 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
896
897 $content[] = '<form action="" method="POST">';
898 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
899 if( current_user_can( 'manage_options' ) ){
900 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
901 ">Dismiss ad</button>';
902 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
903 }
904 $content[] = '</div>';
905 $content[] = '</form>';
906
907 $content[] = '</div>';
908
909 $content[] = '</div>';
910
911 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
912
913 $content[] = '<div id="ays-chart-countdown-main-container">';
914 $content[] = '<div class="ays-chart-countdown-container">';
915
916 $content[] = '<div id="ays-chart-countdown">';
917
918 $content[] = '<div style="font-weight: 500;">';
919 $content[] = __( "Offer ends in:", "chart-builder" );
920 $content[] = '</div>';
921
922 $content[] = '<ul>';
923 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
924 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
925 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
926 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
927 $content[] = '</ul>';
928 $content[] = '</div>';
929
930 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
931 $content[] = '<span>🚀</span>';
932 $content[] = '<span>⌛</span>';
933 $content[] = '<span>🔥</span>';
934 $content[] = '<span>💣</span>';
935 $content[] = '</div>';
936
937 $content[] = '</div>';
938 $content[] = '</div>';
939
940 $content[] = '</div>';
941
942 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
943 $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>';
944 $content[] = '<span >One-time payment</span>';
945 $content[] = '</div>';
946 $content[] = '</div>';
947 $content[] = '</div>';
948
949 $content = implode( '', $content );
950 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
951
952 }
953 }
954
955 // Self 20% sale
956 public static function ays_chart_sale_message20($ishmar){
957 if($ishmar == 0 ){
958 $content = array();
959
960 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
961 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
962 // $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>';
963
964 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
965
966 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
967 $content[] = '<span class="ays-chart-new-chart-pro-title">';
968 // Translators: %s is the URL to the Chart Builder plugin page.
969 $content[] = sprintf(
970 /* translators: %s is the Chart Builder plugin URL. */
971 __(
972 "<span><a href='%s' target='_blank' style='color:#ffffff; text-decoration: underline;'>Chart Builder</a></span>",
973 'chart-builder'
974 ),
975 "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
976 );
977 $content[] = '</span>';
978 $content[] = '<div>';
979 $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
980 $content[] = '</div>';
981 $content[] = '</div>';
982
983 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
984 $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
985 $content[] = esc_html__( "30 Days Money Back Guarantee", 'chart-builder' );
986 $content[] = '</span>';
987
988 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
989 $content[] = '<form method="POST">';
990 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
991 if (current_user_can( 'manage_options' )) {
992 $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>';
993 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
994 }
995 $content[] = '</div>';
996 $content[] = '</form>';
997 $content[] = '</div>';
998
999 $content[] = '</div>';
1000
1001 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1002
1003 $content[] = '<div id="ays-chart-countdown-main-container">';
1004 $content[] = '<div class="ays-chart-countdown-container">';
1005 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1006 $content[] = esc_html__( "Offer ends in:", 'chart-builder' );
1007
1008 $content[] = '<ul style="padding: 0">';
1009 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . esc_html__( 'Days', 'chart-builder' ) . '</li>';
1010 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . esc_html__( 'Hours', 'chart-builder' ) . '</li>';
1011 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . esc_html__( 'Minutes', 'chart-builder' ) . '</li>';
1012 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . esc_html__( 'Seconds', 'chart-builder' ) . '</li>';
1013 $content[] = '</ul>';
1014 $content[] = '</div>';
1015
1016 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1017 $content[] = '<span>🚀</span>';
1018 $content[] = '<span>⌛</span>';
1019 $content[] = '<span>🔥</span>';
1020 $content[] = '<span>💣</span>';
1021 $content[] = '</div>';
1022 $content[] = '</div>';
1023 $content[] = '</div>';
1024
1025 $content[] = '</div>';
1026
1027 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1028 $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>';
1029 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1030 $content[] = esc_html__( "One-time payment", 'chart-builder' );
1031 $content[] = '</span>';
1032 $content[] = '</div>';
1033
1034 $content[] = '</div>';
1035
1036 $content[] = '</div>';
1037
1038 $content = implode( '', $content );
1039 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1040 }
1041 }
1042
1043 // Helloween banner
1044 public static function ays_chart_helloween_message($ishmar){
1045 if($ishmar == 0 ){
1046 $content = array();
1047
1048 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1049 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
1050 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
1051
1052 $content[] = '<p>';
1053 $content[] = __( "Limited Time
1054 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
1055 <span>
1056 SALE on
1057 </span>
1058 <br>
1059 <span style='' class='ays-chart-helloween-bundle'>
1060 <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;'>
1061 Chart Builder
1062 </a>
1063 </span>", 'chart-builder' );
1064 $content[] = '</p>';
1065 $content[] = '<p>';
1066 $content[] = __( "Hurry up!
1067 <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;'>
1068 Check it out!
1069 </a>", 'chart-builder' );
1070 $content[] = '</p>';
1071
1072 $content[] = '</div>';
1073
1074
1075 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
1076 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
1077 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
1078 $content[] = '<div class="ays-chart-countdown-container-helloween">';
1079 $content[] = '<div id="ays-chart-countdown">';
1080 $content[] = '<ul>';
1081 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
1082 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
1083 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
1084 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
1085 $content[] = '</ul>';
1086 $content[] = '</div>';
1087
1088 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1089 $content[] = '<span>🚀</span>';
1090 $content[] = '<span>⌛</span>';
1091 $content[] = '<span>🔥</span>';
1092 $content[] = '<span>💣</span>';
1093 $content[] = '</div>';
1094
1095 $content[] = '</div>';
1096
1097 $content[] = '</div>';
1098
1099 $content[] = '</div>';
1100 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1101 $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>';
1102 $content[] = '</div>';
1103 $content[] = '</div>';
1104
1105 $content[] = '</div>';
1106
1107 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1108 $content[] = '<form method="POST">';
1109 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1110 if( current_user_can( 'manage_options' ) ){
1111 $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>';
1112 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1113 }
1114 $content[] = '</div>';
1115 $content[] = '</form>';
1116
1117 $content[] = '</div>';
1118 // $content[] = '<button type="button" class="notice-dismiss">';
1119 // $content[] = '</button>';
1120 $content[] = '</div>';
1121
1122 $content = implode( '', $content );
1123
1124 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1125 }
1126 }
1127
1128 // Black Friday banner
1129 public static function ays_chart_black_friday_message($ishmar){
1130 if($ishmar == 0 ){
1131 $content = array();
1132
1133 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1134 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1135 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1136 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1137 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Limited Time', "chart-builder" ) .' '. '<a href="https://ays-pro.com/wordpress/chart-builder?utm_medium=chart-free&utm_campaign=black-friday-sale-banner" class="ays-chart-dicount-black-friday-button-sale" target="_blank">' . __( 'Sale', "chart-builder" ) . '</a>' . '</div>';
1138 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1139 $content[] = '</div>';
1140
1141 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1142 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1143 $content[] = '</div>';
1144
1145 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1146 $content[] = '<div id="ays-chart-countdown-main-container">';
1147 $content[] = '<div class="ays-chart-countdown-container">';
1148 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1149 $content[] = '<ul>';
1150 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1151 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1152 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1153 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1154 $content[] = '</ul>';
1155 $content[] = '</div>';
1156 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1157 $content[] = '<span>🚀</span>';
1158 $content[] = '<span>⌛</span>';
1159 $content[] = '<span>🔥</span>';
1160 $content[] = '<span>💣</span>';
1161 $content[] = '</div>';
1162 $content[] = '</div>';
1163 $content[] = '</div>';
1164 $content[] = '</div>';
1165
1166 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1167 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_medium=chart-free&utm_campaign=black-friday-sale-banner" class="ays-chart-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "chart-builder" ) . '</a>';
1168 $content[] = '</div>';
1169 $content[] = '</div>';
1170 $content[] = '</div>';
1171
1172 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1173 $content[] = '<form method="POST">';
1174 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1175 if( current_user_can( 'manage_options' ) ){
1176 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1177 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1178 }
1179 $content[] = '</div>';
1180 $content[] = '</form>';
1181 $content[] = '</div>';
1182 $content[] = '</div>';
1183
1184 $content = implode( '', $content );
1185
1186 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1187 }
1188 }
1189
1190 // Christmas banner
1191 public static function ays_chart_christmas_message($ishmar){
1192 if($ishmar == 0 ){
1193 $content = array();
1194
1195 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1196 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1197 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1198 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1199 $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>';
1200 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', 'chart-builder' ) . '</div>';
1201 $content[] = '</div>';
1202
1203 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1204 $content[] = '<div id="ays-chart-countdown-main-container">';
1205 $content[] = '<div class="ays-chart-countdown-container">';
1206 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1207 $content[] = '<ul>';
1208 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', 'chart-builder' ) . '</li>';
1209 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', 'chart-builder' ) . '</li>';
1210 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', 'chart-builder' ) . '</li>';
1211 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', 'chart-builder' ) . '</li>';
1212 $content[] = '</ul>';
1213 $content[] = '</div>';
1214 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1215 $content[] = '<span>🚀</span>';
1216 $content[] = '<span>⌛</span>';
1217 $content[] = '<span>🔥</span>';
1218 $content[] = '<span>💣</span>';
1219 $content[] = '</div>';
1220 $content[] = '</div>';
1221 $content[] = '</div>';
1222 $content[] = '</div>';
1223
1224 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1225 $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>';
1226 $content[] = '</div>';
1227 $content[] = '</div>';
1228 $content[] = '</div>';
1229
1230 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1231 $content[] = '<form method="POST">';
1232 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1233 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', 'chart-builder' ) . '</button>';
1234 $content[] = '</div>';
1235 $content[] = '</form>';
1236 $content[] = '</div>';
1237 $content[] = '</div>';
1238
1239 $content = implode( '', $content );
1240
1241 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1242 }
1243 }
1244
1245 // Silver Bundle
1246 public function ays_chart_silver_bundle_message($ishmar){
1247 if($ishmar == 0 ){
1248 $content = array();
1249
1250 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1251 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1252 $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
1253
1254 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1255
1256 $content[] = '<strong style="font-weight: bold;">';
1257 $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' );
1258 $content[] = '</strong>';
1259
1260 $content[] = '<br>';
1261
1262 $content[] = '<strong>';
1263 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", 'chart-builder' );
1264 $content[] = '</strong>';
1265
1266 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1267
1268 $content[] = '<form method="POST">';
1269 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1270 $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>';
1271 $content[] = '</div>';
1272 $content[] = '</form>';
1273
1274 $content[] = '</div>';
1275
1276 $content[] = '</div>';
1277
1278 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1279
1280 $content[] = '<div id="ays-chart-countdown-main-container">';
1281 $content[] = '<div class="ays-chart-countdown-container">';
1282
1283 $content[] = '<div id="ays-chart-countdown">';
1284 $content[] = '<ul>';
1285 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1286 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1287 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1288 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1289 $content[] = '</ul>';
1290 $content[] = '</div>';
1291
1292 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1293 $content[] = '<span>🚀</span>';
1294 $content[] = '<span>⌛</span>';
1295 $content[] = '<span>🔥</span>';
1296 $content[] = '<span>💣</span>';
1297 $content[] = '</div>';
1298
1299 $content[] = '</div>';
1300 $content[] = '</div>';
1301
1302 $content[] = '</div>';
1303
1304 $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>';
1305 $content[] = '</div>';
1306 $content[] = '</div>';
1307
1308 $content = implode( '', $content );
1309 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1310 }
1311 }
1312
1313 // Black Friday 2024
1314 public function ays_chart_black_friday_message_2024($ishmar){
1315 if($ishmar == 0 ){
1316 $content = array();
1317
1318 $content[] = '<div id="ays-chart-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1319 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1320
1321 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1322
1323 $content[] = '<div id="ays-chart-countdown-main-container">';
1324 $content[] = '<div class="ays-chart-countdown-container">';
1325
1326 $content[] = '<div id="ays-chart-countdown">';
1327
1328 $content[] = '<div>';
1329 $content[] = __( "Offer ends in:", 'chart-builder' );
1330 $content[] = '</div>';
1331
1332 $content[] = '<ul>';
1333 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1334 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1335 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1336 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1337 $content[] = '</ul>';
1338 $content[] = '</div>';
1339
1340 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1341 $content[] = '<span>🚀</span>';
1342 $content[] = '<span>⌛</span>';
1343 $content[] = '<span>🔥</span>';
1344 $content[] = '<span>💣</span>';
1345 $content[] = '</div>';
1346
1347 $content[] = '</div>';
1348 $content[] = '</div>';
1349
1350 $content[] = '</div>';
1351
1352 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1353 $content[] = '<div>';
1354
1355 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1356 $content[] = __( "<span><a href='https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner' class='ays-chart-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", 'chart-builder' );
1357 $content[] = '</span>';
1358
1359 $content[] = '</br>';
1360
1361 $content[] = '<span class="ays-chart-black-friday-bundle-desc">';
1362 $content[] = '<a class="ays-chart-black-friday-bundle-desc" href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" class="ays-chart-black-friday-bundle-title-link" target="_blank">';
1363 $content[] = __( "50% OFF", 'chart-builder' );
1364 $content[] = '</a>';
1365 $content[] = '</span>';
1366 $content[] = '</div>';
1367
1368 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1369
1370 $content[] = '<form action="" method="POST">';
1371 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1372 if( current_user_can( 'manage_options' ) ){
1373 $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>';
1374 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1375 }
1376 $content[] = '</div>';
1377 $content[] = '</form>';
1378
1379 $content[] = '</div>';
1380
1381 $content[] = '</div>';
1382
1383 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1384 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1385 $content[] = '<a class="ays-chart-black-friday-bundle-title-link" href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" target="_blank">';
1386 $content[] = __( 'Silver Bundle', 'chart-builder' );
1387 $content[] = '</a>';
1388 $content[] = '</span>';
1389 $content[] = '</div>';
1390
1391 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1392 $content[] = '<a href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', 'chart-builder' ) . '</a>';
1393 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1394 $content[] = __( "One-time payment", 'chart-builder' );
1395 $content[] = '</span>';
1396 $content[] = '</div>';
1397 $content[] = '</div>';
1398 $content[] = '</div>';
1399
1400 $content = implode( '', $content );
1401 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1402 }
1403 }
1404
1405 //silver bundle
1406 public function ays_chart_new_silver_bundle_message_2025($ishmar){
1407 if($ishmar == 0 ){
1408 $content = array();
1409
1410 $content[] = '<div id="ays-chart-new-silver-bundle-2025-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1411 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1412
1413 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1414 $content[] = '<div>';
1415
1416 $content[] = '<span class="ays-chart-new-silver-bundle-2025-title">';
1417 $content[] = __( "<span><a href='https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=new_silver_bundle_message_2025' style='color:#ffffff; text-decoration: underline;'>Silver Bundle</a></span> (Quiz + Form + Chart)", 'quiz-maker' );
1418 $content[] = '</span>';
1419
1420 $content[] = '</br>';
1421
1422 $content[] = '<span class="ays-chart-new-silver-bundle-2025-desc">';
1423 $content[] = __( "30 Day Money Back Guarantee", 'chart-builder' );
1424 $content[] = '</span>';
1425 $content[] = '</div>';
1426
1427 $content[] = '<div>';
1428 $content[] = '<img class="ays-chart-new-silver-bundle-guaranteeicon" src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-silver-bundle-2025-discount.svg" style="width: 80px;">';
1429 $content[] = '</div>';
1430
1431 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1432
1433 $content[] = '<form action="" method="POST">';
1434 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1435 if( current_user_can( 'manage_options' ) ){
1436 $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>';
1437 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1438 }
1439 $content[] = '</div>';
1440 $content[] = '</form>';
1441
1442 $content[] = '</div>';
1443
1444 $content[] = '</div>';
1445
1446 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1447
1448 $content[] = '<div id="ays-chart-countdown-main-container">';
1449 $content[] = '<div class="ays-chart-countdown-container">';
1450
1451 $content[] = '<div id="ays-chart-countdown">';
1452
1453 $content[] = '<ul>';
1454 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1455 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1456 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1457 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1458 $content[] = '</ul>';
1459 $content[] = '</div>';
1460
1461 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1462 $content[] = '<span></span>';
1463 $content[] = '<span></span>';
1464 $content[] = '<span></span>';
1465 $content[] = '<span></span>';
1466 $content[] = '</div>';
1467
1468 $content[] = '</div>';
1469 $content[] = '</div>';
1470
1471 $content[] = '</div>';
1472
1473 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1474 $content[] = '<a href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=new-silver-bundle-message-2025" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'chart-builder' ) . '</a>';
1475 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1476 $content[] = __( "One-time payment", 'chart-builder' );
1477 $content[] = '</span>';
1478 $content[] = '</div>';
1479 $content[] = '</div>';
1480 $content[] = '</div>';
1481
1482 $content = implode( '', $content );
1483 echo wp_kses_post($content);
1484 }
1485 }
1486
1487
1488 // Christmas Top Banner 2024
1489 public function ays_chart_christmas_message_2024($ishmar){
1490 if($ishmar == 0 ){
1491 $content = array();
1492
1493 $content[] = '<div id="ays-chart-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1494 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1495
1496 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1497
1498 $content[] = '<div id="ays-chart-countdown-main-container">';
1499 $content[] = '<div class="ays-chart-countdown-container">';
1500
1501 $content[] = '<div id="ays-chart-countdown">';
1502
1503 $content[] = '<div>';
1504 $content[] = __( "Offer ends in:", 'chart-builder' );
1505 $content[] = '</div>';
1506
1507 $content[] = '<ul style="padding-left: 0;">';
1508 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1509 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1510 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1511 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1512 $content[] = '</ul>';
1513 $content[] = '</div>';
1514
1515 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1516 $content[] = '<span>🚀</span>';
1517 $content[] = '<span>⌛</span>';
1518 $content[] = '<span>🔥</span>';
1519 $content[] = '<span>💣</span>';
1520 $content[] = '</div>';
1521
1522 $content[] = '</div>';
1523 $content[] = '</div>';
1524
1525 $content[] = '</div>';
1526
1527 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1528 $content[] = '<div>';
1529
1530 $content[] = '<span class="ays-chart-christmas-top-bundle-title">';
1531 $content[] = sprintf(
1532 /* translators: %s is the Chart Builder plugin URL with version parameter. */
1533 __(
1534 "<span><a href='%s' class='ays-chart-christmas-top-bundle-title-link' target='_blank'>Christmas Sale</a></span>",
1535 'chart-builder'
1536 ),
1537 "https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" . CHART_BUILDER_VERSION
1538 );
1539 $content[] = '</span>';
1540
1541 $content[] = '</br>';
1542
1543 $content[] = '<span class="ays-chart-christmas-top-bundle-desc">';
1544 $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">';
1545 $content[] = __( "20% Extra OFF", 'chart-builder' );
1546 $content[] = '</a>';
1547 $content[] = '</span>';
1548 $content[] = '</div>';
1549
1550 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1551
1552 $content[] = '<form action="" method="POST">';
1553 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1554 if( current_user_can( 'manage_options' ) ){
1555 $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>';
1556 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1557 }
1558 $content[] = '</div>';
1559 $content[] = '</form>';
1560
1561 $content[] = '</div>';
1562
1563 $content[] = '</div>';
1564
1565 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-christmas-top-bundle-coupon-text-box">';
1566 $content[] = '<div class="ays-chart-christmas-top-bundle-coupon-row">';
1567 $content[] = 'xmas20off';
1568 $content[] = '</div>';
1569 $content[] = '<div class="ays-chart-christmas-top-bundle-text-row">';
1570 $content[] = __( '20% Extra Discount Coupon', 'chart-builder' );
1571 $content[] = '</div>';
1572 $content[] = '</div>';
1573
1574 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1575 $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>';
1576 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1577 $content[] = __( "One-time payment", 'chart-builder' );
1578 $content[] = '</span>';
1579 $content[] = '</div>';
1580 $content[] = '</div>';
1581 $content[] = '</div>';
1582
1583 $content = implode( '', $content );
1584 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1585 }
1586 }
1587
1588 public function ays_chart_update_banner_time(){
1589
1590 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1591 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1592 $next_3_days = gmdate('M d, Y H:i:s', $date);
1593
1594 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1595
1596 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1597 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1598 }
1599
1600 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1601
1602 $val = 60*60*24*0.5; // half day
1603 // $val = 60; // for testing | 1 min
1604
1605 $current_date = current_time( 'mysql' );
1606 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1607
1608 $days_diff = $date_diff / $val;
1609 if(intval($days_diff) > 0 ){
1610 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1611 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1612 }
1613
1614 return $get_ays_chart_banner_time;
1615 }
1616
1617 public function author_user_search() {
1618 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1619 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
1620 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1621 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1622 $args = 'search=';
1623 if ($search !== null) {
1624 $args .= '*';
1625 $args .= $search;
1626 $args .= '*';
1627 }
1628
1629 $users = get_users($args);
1630
1631 $content_text = array(
1632 'results' => array()
1633 );
1634
1635 foreach ($users as $key => $value) {
1636 if ($checked !== null) {
1637 if ( !is_array( $checked ) ) {
1638 $checked2 = $checked;
1639 $checked = array();
1640 $checked[] = absint($checked2);
1641 }
1642 if (in_array($value->ID, $checked)) {
1643 continue;
1644 } else {
1645 $content_text['results'][] = array(
1646 'id' => $value->ID,
1647 'text' => $value->data->display_name,
1648 );
1649 }
1650 } else {
1651 $content_text['results'][] = array(
1652 'id' => $value->ID,
1653 'text' => $value->data->display_name,
1654 );
1655 }
1656 }
1657
1658 ob_end_clean();
1659 echo json_encode($content_text);
1660 wp_die();
1661 }
1662
1663 /**
1664 * Determine if the plugin/addon installations are allowed.
1665 *
1666 * @since 6.4.0.4
1667 *
1668 * @param string $type Should be `plugin` or `addon`.
1669 *
1670 * @return bool
1671 */
1672 public static function ays_chart_can_install( $type ) {
1673
1674 return self::ays_chart_can_do( 'install', $type );
1675 }
1676
1677 /**
1678 * Determine if the plugin/addon activations are allowed.
1679 *
1680 * @since 6.4.0.4
1681 *
1682 * @param string $type Should be `plugin` or `addon`.
1683 *
1684 * @return bool
1685 */
1686 public static function ays_chart_can_activate( $type ) {
1687
1688 return self::ays_chart_can_do( 'activate', $type );
1689 }
1690
1691 /**
1692 * Determine if the plugin/addon installations/activations are allowed.
1693 *
1694 * @since 6.4.0.4
1695 *
1696 * @param string $what Should be 'activate' or 'install'.
1697 * @param string $type Should be `plugin` or `addon`.
1698 *
1699 * @return bool
1700 */
1701 public static function ays_chart_can_do( $what, $type ) {
1702
1703 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1704 return false;
1705 }
1706
1707 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1708 return false;
1709 }
1710
1711 $capability = $what . '_plugins';
1712
1713 if ( ! current_user_can( $capability ) ) {
1714 return false;
1715 }
1716
1717 // Determine whether file modifications are allowed and it is activation permissions checking.
1718 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1719 return false;
1720 }
1721
1722 // All plugin checks are done.
1723 if ( $type === 'plugin' ) {
1724 return true;
1725 }
1726 return false;
1727 }
1728
1729 /**
1730 * Activate plugin.
1731 *
1732 * @since 1.0.0
1733 * @since 6.4.0.4 Updated the permissions checking.
1734 */
1735 public function ays_chart_activate_plugin() {
1736
1737 // Run a security check.
1738 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1739 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1740 }
1741
1742 // Check for permissions.
1743 if ( ! current_user_can( 'activate_plugins' ) ) {
1744 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1745 }
1746
1747 $type = 'addon';
1748
1749 if ( isset( $_POST['plugin'] ) ) {
1750
1751 if ( ! empty( $_POST['type'] ) ) {
1752 $type = sanitize_key( $_POST['type'] );
1753 }
1754
1755 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1756 $activate = activate_plugins( $plugin );
1757
1758 if ( ! is_wp_error( $activate ) ) {
1759 if ( $type === 'plugin' ) {
1760 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1761 } else {
1762 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1763 }
1764 }
1765 }
1766
1767 if ( $type === 'plugin' ) {
1768 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1769 }
1770
1771 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1772 }
1773
1774 /**
1775 * Install addon.
1776 *
1777 * @since 1.0.0
1778 * @since 6.4.0.4 Updated the permissions checking.
1779 */
1780 public function ays_chart_install_plugin() {
1781
1782 // Run a security check.
1783 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1784 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1785 }
1786
1787 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1788 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1789
1790 // Check if new installations are allowed.
1791 if ( ! self::ays_chart_can_install( $type ) ) {
1792 wp_send_json_error( $generic_error );
1793 }
1794
1795 $error = $type === 'plugin'
1796 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1797 : "";
1798
1799 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1800
1801 if ( empty( $plugin_url ) ) {
1802 wp_send_json_error( $error );
1803 }
1804
1805 // Prepare variables.
1806 $url = esc_url_raw(
1807 add_query_arg(
1808 [
1809 'page' => 'chart-builder-featured-plugins',
1810 ],
1811 admin_url( 'admin.php' )
1812 )
1813 );
1814
1815 ob_start();
1816 $creds = request_filesystem_credentials( $url, '', false, false, null );
1817
1818 // Hide the filesystem credentials form.
1819 ob_end_clean();
1820
1821 // Check for file system permissions.
1822 if ( $creds === false ) {
1823 wp_send_json_error( $error );
1824 }
1825
1826 if ( ! WP_Filesystem( $creds ) ) {
1827 wp_send_json_error( $error );
1828 }
1829
1830 /*
1831 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1832 */
1833 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1834 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1835 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1836
1837
1838 // Do not allow WordPress to search/download translations, as this will break JS output.
1839 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1840
1841 // Create the plugin upgrader with our custom skin.
1842 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1843
1844 // Error check.
1845 if ( ! method_exists( $installer, 'install' ) ) {
1846 wp_send_json_error( $error );
1847 }
1848
1849 $installer->install( $plugin_url );
1850
1851 // Flush the cache and return the newly installed plugin basename.
1852 wp_cache_flush();
1853
1854 $plugin_basename = $installer->plugin_info();
1855
1856 if ( empty( $plugin_basename ) ) {
1857 wp_send_json_error( $error );
1858 }
1859
1860 $result = array(
1861 'msg' => $generic_error,
1862 'is_activated' => false,
1863 'basename' => $plugin_basename,
1864 );
1865
1866 // Check for permissions.
1867 if ( ! current_user_can( 'activate_plugins' ) ) {
1868 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1869
1870 wp_send_json_success( $result );
1871 }
1872
1873 // Activate the plugin silently.
1874 $activated = activate_plugin( $plugin_basename );
1875 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1876
1877 if ( ! is_wp_error( $activated ) ) {
1878
1879 $result['is_activated'] = true;
1880 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1881
1882 wp_send_json_success( $result );
1883 }
1884
1885 // Fallback error just in case.
1886 wp_send_json_error( $result );
1887 }
1888
1889 /**
1890 * List of AM plugins that we propose to install.
1891 *
1892 * @since 6.4.0.4
1893 *
1894 * @return array
1895 */
1896 protected function get_am_plugins() {
1897 if ( !isset( $_SESSION ) ) {
1898 session_start();
1899 }
1900
1901 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1902
1903 $plugin_slug = array(
1904 'fox-lms',
1905 'quiz-maker',
1906 'survey-maker',
1907 'poll-maker',
1908 'ays-popup-box',
1909 'secure-copy-content-protection',
1910 'gallery-photo-gallery',
1911 'ays-chatgpt-assistant',
1912 'easy-form',
1913 );
1914
1915 $plugin_url_arr = array();
1916 foreach ($plugin_slug as $key => $slug) {
1917 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1918 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1919 $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])) : "";
1920 } else {
1921 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1922 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1923 if ( $latest_version != '' ) {
1924 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1925 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1926 }
1927 }
1928
1929 $plugin_url_arr[$slug] = $plugin_url;
1930 }
1931
1932 $plugins_array = array(
1933 'fox-lms/fox-lms.php' => array(
1934 'icon' => $images_url . 'icon-fox-lms-128x128.png',
1935 'name' => __( 'Fox LMS', 'chart-builder' ),
1936 'desc' => __( 'Build and manage online courses directly on your WordPress site.', 'chart-builder' ),
1937 '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' ),
1938 'wporg' => 'https://wordpress.org/plugins/fox-lms/',
1939 'buy_now' => 'https://foxlms.com/pricing/?utm_source=dashboard&utm_medium=chart-free&utm_campaign=fox-lms-our-products-page',
1940 'url' => $plugin_url_arr['fox-lms'],
1941 ),
1942 'quiz-maker/quiz-maker.php' => array(
1943 'icon' => $images_url . 'icon-quiz-128x128.png',
1944 'name' => __( 'Quiz Maker', 'chart-builder' ),
1945 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', 'chart-builder' ),
1946 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', 'chart-builder' ),
1947 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1948 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1949 'url' => $plugin_url_arr['quiz-maker'],
1950 ),
1951 'survey-maker/survey-maker.php' => array(
1952 'icon' => $images_url . 'icon-survey-128x128.png',
1953 'name' => __( 'Survey Maker', 'chart-builder' ),
1954 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1955 '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' ),
1956 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1957 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1958 'url' => $plugin_url_arr['survey-maker'],
1959 ),
1960 'poll-maker/poll-maker-ays.php' => array(
1961 'icon' => $images_url . 'icon-poll-128x128.png',
1962 'name' => __( 'Poll Maker', 'chart-builder' ),
1963 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1964 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1965 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1966 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1967 'url' => $plugin_url_arr['poll-maker'],
1968 ),
1969 'ays-popup-box/ays-pb.php' => array(
1970 'icon' => $images_url . 'icon-popup-128x128.png',
1971 'name' => __( 'Popup Box', 'chart-builder' ),
1972 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1973 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1974 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1975 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1976 'url' => $plugin_url_arr['ays-popup-box'],
1977 ),
1978 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1979 'icon' => $images_url . 'icon-sccp-128x128.png',
1980 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1981 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1982 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1983 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1984 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1985 'url' => $plugin_url_arr['secure-copy-content-protection'],
1986 ),
1987 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1988 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1989 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1990 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1991 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1992 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1993 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1994 'url' => $plugin_url_arr['gallery-photo-gallery'],
1995 ),
1996 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1997 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1998 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1999 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
2000 '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' ),
2001 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
2002 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
2003 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
2004 ),
2005 'easy-form/easy-form.php' => array(
2006 'icon' => $images_url . 'icon-form-128x128.png',
2007 'name' => __( 'Easy Form', 'chart-builder' ),
2008 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
2009 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
2010 'wporg' => 'https://wordpress.org/plugins/easy-form/',
2011 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
2012 'url' => $plugin_url_arr['easy-form'],
2013 ),
2014 );
2015
2016 return $plugins_array;
2017 }
2018
2019 protected function ays_chart_get_latest_plugin_version( $slug ){
2020
2021 if ( is_null( $slug ) || empty($slug) ) {
2022 return "";
2023 }
2024
2025 $version_latest = "";
2026
2027 if ( ! function_exists( 'plugins_api' ) ) {
2028 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
2029 }
2030
2031 // set the arguments to get latest info from repository via API ##
2032 $args = array(
2033 'slug' => $slug,
2034 'fields' => array(
2035 'version' => true,
2036 )
2037 );
2038
2039 /** Prepare our query */
2040 $call_api = plugins_api( 'plugin_information', $args );
2041
2042 /** Check for Errors & Display the results */
2043 if ( is_wp_error( $call_api ) ) {
2044 $api_error = $call_api->get_error_message();
2045 } else {
2046
2047 //echo $call_api;
2048 // everything ##
2049 if ( ! empty( $call_api->version ) ) {
2050 $version_latest = $call_api->version;
2051 }
2052 }
2053
2054 return $version_latest;
2055 }
2056
2057 /**
2058 * Get AM plugin data to display in the Addons section of About tab.
2059 *
2060 * @since 6.4.0.4
2061 *
2062 * @param string $plugin Plugin slug.
2063 * @param array $details Plugin details.
2064 * @param array $all_plugins List of all plugins.
2065 *
2066 * @return array
2067 */
2068 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
2069
2070 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
2071 $show_pro = false;
2072
2073 $plugin_data = array();
2074
2075 if ( $have_pro ) {
2076 if ( array_key_exists( $plugin, $all_plugins ) ) {
2077 if ( is_plugin_active( $plugin ) ) {
2078 $show_pro = true;
2079 }
2080 }
2081 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
2082 $show_pro = true;
2083 }
2084 if ( $show_pro ) {
2085 $plugin = $details['pro']['plug'];
2086 $details = $details['pro'];
2087 }
2088 }
2089
2090 if ( array_key_exists( $plugin, $all_plugins ) ) {
2091 if ( is_plugin_active( $plugin ) ) {
2092 // Status text/status.
2093 $plugin_data['status_class'] = 'status-active';
2094 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
2095 // Button text/status.
2096 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
2097 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
2098 $plugin_data['plugin_src'] = esc_attr( $plugin );
2099 } else {
2100 // Status text/status.
2101 $plugin_data['status_class'] = 'status-installed';
2102 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
2103 // Button text/status.
2104 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2105 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
2106 $plugin_data['plugin_src'] = esc_attr( $plugin );
2107 }
2108 } else {
2109 // Doesn't exist, install.
2110 // Status text/status.
2111 $plugin_data['status_class'] = 'status-missing';
2112
2113 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
2114 $plugin_data['status_class'] = 'status-go-to-url';
2115 }
2116 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
2117 // Button text/status.
2118 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2119 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
2120 $plugin_data['plugin_src'] = esc_url( $details['url'] );
2121 }
2122
2123 $plugin_data['details'] = $details;
2124
2125 return $plugin_data;
2126 }
2127
2128 /**
2129 * Display the Addons section of About tab.
2130 *
2131 * @since 6.4.0.4
2132 */
2133 public function output_about_addons() {
2134
2135 if ( ! function_exists( 'get_plugins' ) ) {
2136 require_once ABSPATH . 'wp-admin/includes/plugin.php';
2137 }
2138
2139 $all_plugins = get_plugins();
2140 $am_plugins = $this->get_am_plugins();
2141 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
2142 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
2143
2144 $content = '';
2145 $content.= '<div class="ays-chart-cards-block">';
2146 foreach ( $am_plugins as $plugin => $details ){
2147
2148 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
2149 $plugin_ready_to_activate = $can_activate_plugins
2150 && isset( $plugin_data['status_class'] )
2151 && $plugin_data['status_class'] === 'status-installed';
2152 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
2153 || $plugin_data['status_class'] !== 'status-active';
2154
2155 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
2156
2157 $plugin_action_class_disbaled = "";
2158 if ( strpos($plugin_action_class, 'status-active') !== false ) {
2159 $plugin_action_class_disbaled = "disbaled='true'";
2160 }
2161
2162 $content .= '
2163 <div class="ays-chart-card">
2164 <div class="ays-chart-card__content flexible">
2165 <div class="ays-chart-card__content-img-box">
2166 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
2167 </div>
2168 <div class="ays-chart-card__text-block">
2169 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
2170 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
2171 <span class="ays-chart-card__text-hidden">
2172 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
2173 </span>
2174 </p>
2175 </div>
2176 </div>
2177 <div class="ays-chart-card__footer">';
2178 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
2179 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
2180 '. wp_kses_post( $plugin_data['action_text'] ) .'
2181 </button>';
2182 }
2183 elseif ( $plugin_not_activated ) {
2184 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
2185 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
2186 <span aria-hidden="true" class="dashicons dashicons-external"></span>
2187 </a>';
2188 }
2189 $content .='
2190 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', 'chart-builder') .'</a>
2191 </div>
2192 </div>';
2193 }
2194 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
2195 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
2196 $content.= '</div>';
2197
2198 echo html_entity_decode($content);
2199 }
2200
2201 /**
2202 * Returns the data from Quiz maker.
2203 *
2204 * @access public
2205 */
2206 public function fetch_quiz_maker_data(){
2207 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
2208
2209 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2210 if ( !isset($params) || empty($params) ) {
2211 return array(
2212 'success' => false,
2213 'data' => array(
2214 'msg' => __( "Something went wrong.", "chart-builder" )
2215 )
2216 );
2217 }
2218
2219 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2220 if ( $query == '' ) {
2221 return array(
2222 'success' => false,
2223 'data' => array(
2224 'msg' => __( "No data given.", "chart-builder" )
2225 )
2226 );
2227 }
2228 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
2229 $user_id = get_current_user_id();
2230
2231 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
2232
2233 if (empty($return_results)) {
2234 return array(
2235 'success' => false,
2236 'data' => array(
2237 'msg' => __( "Something went wrong.", "chart-builder" )
2238 )
2239 );
2240 }
2241
2242 $result_values = $return_results['result'];
2243 $query = $return_results['query'];
2244
2245 if (empty($result_values)) {
2246 return array(
2247 'success' => false,
2248 'data' => array(
2249 'msg' => $return_results['message']
2250 )
2251 );
2252 }
2253
2254 if (count($return_results['result'][0]) != 1 ) {
2255 $results = array();
2256 $headers = array();
2257 if ( $result_values ) {
2258 $row_num = 0;
2259 foreach ( $result_values as $row ) {
2260 $result = array();
2261 foreach ( $row as $k => $v ) {
2262 $result[] = $v;
2263 if ( $row_num === 0 ) {
2264 $headers[] = $k;
2265 }
2266 }
2267 $results[] = $result;
2268 $row_num++;
2269 }
2270 }
2271 } else if (count($return_results['result'][0]) == 1) {
2272 $results = array();
2273 $headers = array();
2274 if ( $result_values ) {
2275 $row_num = 0;
2276 foreach ( $result_values as $index => $row ) {
2277 $result = array();
2278 foreach ( $row as $k => $v ) {
2279 $result[] = strval($index) + 1;
2280 $result[] = $v;
2281 if ( $row_num === 0 ) {
2282 $headers[] = 'Quiz';
2283 $headers[] = $k;
2284 }
2285 }
2286 $results[] = $result;
2287 $row_num++;
2288 }
2289 }
2290 }
2291
2292 if (empty($results)) {
2293 return array(
2294 'success' => false,
2295 'data' => array(
2296 'msg' => $return_results['message']
2297 )
2298 );
2299 }
2300
2301 foreach ($results as $key => $value) {
2302 if (!isset($value) || count($value) <= 1 && $key != 0) {
2303 unset($results[$key]);
2304 }
2305 }
2306
2307 array_unshift($results, $headers);
2308 $results = array_values( $results );
2309 $data = $results;
2310
2311 $headers = $results[0];
2312 unset( $results[0] );
2313
2314 $html = CBFunctions()->get_table_html( $headers, $results );
2315
2316 return array(
2317 'success' => true,
2318 'data' => array(
2319 'table' => $html,
2320 'data' => $data
2321 )
2322 );
2323 }
2324
2325 /**
2326 * Saves the Quiz maker data.
2327 *
2328 * @access public
2329 */
2330 public function save_quiz_maker_data() {
2331 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2332
2333 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2334 if ( !isset($params) || empty($params) ) {
2335 return array(
2336 'success' => false,
2337 'data' => array(
2338 'msg' => __( "Something went wrong.", "chart-builder" )
2339 )
2340 );
2341 }
2342
2343 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2344 if ( $query_id == '' ) {
2345 return array(
2346 'success' => false,
2347 'data' => array(
2348 'msg' => __( "No data given.", "chart-builder" )
2349 )
2350 );
2351 }
2352
2353 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2354 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2355 $user_id = get_current_user_id();
2356
2357 if ( $chart_id >= 0 ) {
2358
2359 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2360
2361 if (empty($return_results)) {
2362 return array(
2363 'success' => false,
2364 'data' => array(
2365 'msg' => __( "Something went wrong.", "chart-builder" )
2366 )
2367 );
2368 }
2369
2370 $result_values = $return_results['result'];
2371 $query = $return_results['query'];
2372
2373 if (empty($result_values)) {
2374 return array(
2375 'success' => false,
2376 'data' => array(
2377 'msg' => $return_results['message']
2378 )
2379 );
2380 }
2381
2382 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2383 $results = array();
2384 $headers = array();
2385 if ( $result_values ) {
2386 $row_num = 0;
2387 foreach ( $result_values as $row ) {
2388 $result = array();
2389 foreach ( $row as $k => $v ) {
2390 $result[] = $v;
2391 if ( $row_num === 0 ) {
2392 $headers[] = $k;
2393 }
2394 }
2395 $results[] = $result;
2396 $row_num++;
2397 }
2398 }
2399 } else if (count($return_results['result'][0]) == 1) {
2400 $results = array();
2401 $headers = array();
2402 if ( $result_values ) {
2403 $row_num = 0;
2404 foreach ( $result_values as $index => $row ) {
2405 $result = array();
2406 foreach ( $row as $k => $v ) {
2407 $result[] = strval($index) + 1;
2408 $result[] = $v;
2409 if ( $row_num === 0 ) {
2410 $headers[] = 'Quiz';
2411 $headers[] = $k;
2412 }
2413 }
2414 $results[] = $result;
2415 $row_num++;
2416 }
2417 }
2418 }
2419
2420 $source_type = 'quiz_maker';
2421 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2422 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2423
2424 update_option( $option_name_for_data, array(
2425 'source_type' => $source_type,
2426 'source' => $query,
2427 'data' => $results,
2428 ) );
2429 update_option( $option_name_for_quiz, array(
2430 'quiz_query' => $query_id,
2431 'quiz_id' => $quiz_id
2432 ) );
2433
2434 } else {
2435 return array(
2436 'success' => false,
2437 'data' => array(
2438 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2439 )
2440 );
2441 }
2442
2443 return array(
2444 'success' => true,
2445 'data' => array(
2446 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2447 )
2448 );
2449 }
2450
2451 /**
2452 * Chart page action hooks
2453 */
2454
2455 /**
2456 * Chart page sources contents
2457 * @param $args
2458 */
2459 public function ays_chart_page_source_contents( $args ){
2460 $chart_source_type = $args['chart_source_type'];
2461
2462 if ($chart_source_type === 'chart-js') {
2463 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2464 } else {
2465 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2466 }
2467
2468 $source_type = $args['source_type'];
2469
2470 $sources = array();
2471 foreach ( $sources_contents as $key => $sources_content ) {
2472 $collapsed = $key == $source_type ? 'false' : 'true';
2473
2474 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2475 if( isset( $sources_content['title'] ) ){
2476 $content .= '<legend class="ays-accordion-options-header">';
2477 $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">
2478 <g>
2479 <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" />
2480 </g>
2481 </svg>';
2482
2483 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2484 }
2485
2486 $content .= '<div class="ays-accordion-options-content">';
2487 $content .= $sources_content['content'];
2488 $content .= '</div>';
2489
2490 $content .= '</fieldset>';
2491
2492 $sources[] = $content;
2493 }
2494 $content_for_escape = implode('' , $sources );
2495 echo html_entity_decode( esc_html($content_for_escape) );
2496 }
2497
2498 public function source_contents_import_from_csv_settings( $sources, $args ){
2499 $html_class_prefix = $args['html_class_prefix'];
2500 $html_name_prefix = $args['html_name_prefix'];
2501
2502 ob_start();
2503 ?>
2504 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2505 <div class="ays-pro-features-v2-big-buttons-box">
2506 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2507 <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>
2508 <div class="ays-pro-features-v2-video-text">
2509 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2510 </div>
2511 </a>
2512 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2513 <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>
2514 <div class="ays-pro-features-v2-upgrade-text">
2515 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2516 </div>
2517 </a>
2518 </div>
2519 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap">
2520 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2521 <h6><?php echo esc_html__("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2522 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2523 <option value="csv">CSV File</option>
2524 </select>
2525 <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>
2526 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2527 <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>
2528 </p>
2529 <div>
2530 <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" />
2531 </div>
2532 <div class='ays-chart-file-import-success'></div>
2533 <div class='ays-chart-file-import-error'></div>
2534 <div class="ays-chart-buttons-group">
2535 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2536 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2537 </button>
2538 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2539 <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>
2540 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2541 </button>
2542 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2543 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2544 </button>
2545 </div>
2546 </div>
2547 </div>
2548 </div>
2549 <?php
2550 $content = ob_get_clean();
2551
2552 $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") . '">
2553 <i class="ays_fa ays_fa_info_circle"></i>
2554 </a>';
2555
2556 $sources['file_import'] = array(
2557 'content' => $content,
2558 'title' => $title
2559 );
2560
2561 return $sources;
2562 }
2563
2564 public function source_contents_import_from_db_settings( $sources, $args ){
2565 $html_class_prefix = $args['html_class_prefix'];
2566 $html_name_prefix = $args['html_name_prefix'];
2567
2568 ob_start();
2569 ?>
2570 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2571 <div class="ays-pro-features-v2-big-buttons-box">
2572 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2573 <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>
2574 <div class="ays-pro-features-v2-video-text">
2575 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2576 </div>
2577 </a>
2578 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2579 <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>
2580 <div class="ays-pro-features-v2-upgrade-text">
2581 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2582 </div>
2583 </a>
2584 </div>
2585 <div class="<?php echo esc_attr( $html_class_prefix ) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2586 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2587 <div id="ays-chart-db-query">
2588 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2589 <div id="db-query-form">
2590 <input type="hidden" name="chart_id" value="1">
2591 <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>
2592 <div class='db-wizard-success'></div>
2593 <div class='db-wizard-error'></div>
2594 </div>
2595 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2596 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2597 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2598 </button>
2599 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2600 <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>
2601 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2602 </button>
2603 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2604 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2605 </button>
2606 </div>
2607 </div>
2608 <div class="db-wizard-hints">
2609 <ul>
2610 <!-- <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> -->
2611 <li>
2612 <?php
2613 echo sprintf(
2614 /* translators: %1$s and %2$s are HTML span tags for styling. */
2615 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2616 '<span class="ays-chart-emboss">',
2617 '</span>'
2618 );
2619 ?>
2620 </li>
2621 </ul>
2622 </div>
2623 </div>
2624 </div>
2625 </div>
2626 </div>
2627 <?php
2628 $content = ob_get_clean();
2629
2630 $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') . '">
2631 <i class="ays_fa ays_fa_info_circle"></i>
2632 </a>';
2633
2634 $sources['import_from_db'] = array(
2635 'content' => $content,
2636 'title' => $title
2637 );
2638
2639 return $sources;
2640 }
2641
2642 public function source_contents_import_from_external_db_settings( $sources, $args ){
2643 $html_class_prefix = $args['html_class_prefix'];
2644 $html_name_prefix = $args['html_name_prefix'];
2645
2646 ob_start();
2647 ?>
2648 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2649 <div class="ays-pro-features-v2-big-buttons-box">
2650 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2651 <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>
2652 <div class="ays-pro-features-v2-upgrade-text">
2653 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2654 </div>
2655 </a>
2656 </div>
2657 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2658 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2659 <div class="form-group row mb-2">
2660 <div class="col-sm-8 <?php echo esc_attr($html_class_prefix) ?>option-title">
2661 <label class="form-label">
2662 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2663 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2664 <i class="ays_fa ays_fa_info_circle"></i>
2665 </a>
2666 </label>
2667 </div>
2668 <div class="col-sm-3 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2669 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2670 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2671 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2672 </label>
2673 </div>
2674 </div>
2675 <div id="ays-chart-external-db-query">
2676 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2677 <div id="external-db-query-form">
2678 <input type="hidden" name="chart_id" value="1">
2679 <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>
2680 <div class='db-wizard-success'></div>
2681 <div class='db-wizard-error'></div>
2682 </div>
2683 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2684 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2685 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2686 </button>
2687 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2688 <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>
2689 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2690 </button>
2691 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2692 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2693 </button>
2694 </div>
2695 </div>
2696 <div class="db-wizard-hints">
2697 <ul>
2698 <!-- <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> -->
2699 <li>
2700 <?php
2701 echo sprintf(
2702 /* translators: %1$s and %2$s are HTML span tags for styling. */
2703 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2704 '<span class="ays-chart-emboss">',
2705 '</span>'
2706 );
2707 ?>
2708 </li>
2709 </ul>
2710 </div>
2711 </div>
2712 </div>
2713 </div>
2714 </div>
2715 <?php
2716 $content = ob_get_clean();
2717
2718 $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') . '">
2719 <i class="ays_fa ays_fa_info_circle"></i>
2720 </a>';
2721
2722 $sources['import_from_external_db'] = array(
2723 'content' => $content,
2724 'title' => $title
2725 );
2726
2727 return $sources;
2728 }
2729
2730 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2731 global $wpdb;
2732 $chart_id = $args['chart_id'];
2733 $html_class_prefix = $args['html_class_prefix'];
2734 $html_name_prefix = $args['html_name_prefix'];
2735 $source = $args['source'];
2736 $settings = $args['settings'];
2737 $quiz_queries = $args['quiz_queries'];
2738 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2739 $quiz_id = $args['quiz_id'];
2740 $quiz_query = $args['quiz_query'];
2741
2742 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2743 // $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") . '">
2744 // <i class="ays_fa ays_fa_info_circle"></i>
2745 // </a>', '<br>', '<b>', '</b>');
2746 // $content = $this->blockquote_content_quiz;
2747 // $sources['quiz_maker'] = array(
2748 // 'content' => $content,
2749 // 'title' => $title
2750 // );
2751
2752 return $sources;
2753 }
2754 $quizes = $wpdb->get_results( // phpcs:ignore
2755 $wpdb->prepare(
2756 "SELECT `title`, `id` FROM {$wpdb->prefix}aysquiz_quizes
2757 WHERE `published` = %d AND `question_ids` <> %s",
2758 1,
2759 ''
2760 ),
2761 ARRAY_A
2762 );
2763
2764
2765 ob_start();
2766 ?>
2767 <div class="ays-accordion-data-main-wrap">
2768 <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">
2769 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2770 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?php echo esc_attr($chart_id) ?>">
2771 <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">
2772 <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' ) ?>">
2773 <i class="ays_fa ays_fa_info_circle"></i>
2774 </a>
2775 <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">
2776 <option value=""><?php echo esc_html__( "Select query", "chart-builder" ) ?></option>
2777 <?php foreach ( $quiz_queries as $id => $q):
2778 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2779 <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>
2780 <?php endforeach; ?>
2781 </select>
2782 </div>
2783 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2784 <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">
2785 <option value="0"><?php echo esc_html__( "Select quiz", "chart-builder" ) ?></option>
2786 <?php foreach ( $quizes as $quiz): ?>
2787 <option value="<?php echo esc_attr($quiz['id']) ?>" <?php echo $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?php echo esc_html($quiz['title'] )?></option>
2788 <?php endforeach; ?>
2789 </select>
2790 </div>
2791 <div id="ays-chart-quiz-maker-success"></div>
2792 <div id="ays-chart-quiz-maker-error"></div>
2793 <div class="ays-chart-buttons-group">
2794 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2795 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2796 </button>
2797 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2798 <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>
2799 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2800 </button>
2801 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2802 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2803 </button>
2804 </div>
2805 </div>
2806 <div>
2807 <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>
2808 </div>
2809 </div>
2810 </div>
2811 <?php
2812 $content = ob_get_clean();
2813
2814 $title = sprintf(
2815 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2816 __( 'Get Quiz Maker data', 'chart-builder' ) .
2817 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2818 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2819 __( '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' ) . '">
2820 <i class="ays_fa ays_fa_info_circle"></i>
2821 </a>',
2822 '<br>', '<b>', '</b>'
2823 );
2824 $sources['quiz_maker'] = array(
2825 'content' => $content,
2826 'title' => $title
2827 );
2828
2829 return $sources;
2830 }
2831
2832 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2833 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2834 return $sources;
2835 }
2836
2837 $chart_id = $args['chart_id'];
2838 $html_class_prefix = $args['html_class_prefix'];
2839 $html_name_prefix = $args['html_name_prefix'];
2840 ob_start();
2841 ?>
2842 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2843 <div class="ays-pro-features-v2-big-buttons-box">
2844 <div class="ays-pro-features-v2-video-button"></div>
2845 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2846 <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>
2847 <div class="ays-pro-features-v2-upgrade-text">
2848 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2849 </div>
2850 </a>
2851 </div>
2852 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap ">
2853 <div id="ays-chart-woocommerce-datas">
2854 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-form">
2855 <div id="woocommerce-datas-form">
2856 <input type="hidden" name="chart_id" value="<?php echo esc_attr( $chart_id )?>">
2857 <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" >
2858 <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' ) ?>">
2859 <i class="ays_fa ays_fa_info_circle"></i>
2860 </a>
2861 <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]">
2862 <option value=""><?php echo esc_html__( 'Select query', 'chart-builder') ?></option>
2863 </select>
2864 </div>
2865 <div class='ays-chart-woocommerce-datas-success'></div>
2866 <div class='ays-chart-woocommerce-datas-error'></div>
2867 </div>
2868 <div class="ays-chart-buttons-group">
2869 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2870 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2871 </button>
2872 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2873 <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>
2874 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2875 </button>
2876 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2877 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2878 </button>
2879 </div>
2880 </div>
2881 </div>
2882 </div>
2883 </div>
2884 <?php
2885 $content = ob_get_clean();
2886
2887 $title = sprintf(
2888 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2889 esc_html__( 'Get WooCommerce data', 'chart-builder' ) .
2890 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2891 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2892 __( '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' ) . '">
2893 <i class="ays_fa ays_fa_info_circle"></i>
2894 </a>',
2895 '<br>', '<b>', '</b>'
2896 );
2897 $sources['woocommerce'] = array(
2898 'content' => $content,
2899 'title' => $title
2900 );
2901
2902 return $sources;
2903 }
2904
2905 public function source_contents_manual_settings( $sources, $args ){
2906 $html_class_prefix = $args['html_class_prefix'];
2907 $html_name_prefix = $args['html_name_prefix'];
2908 $source = $args['source'];
2909 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2910 $settings = $args['settings'];
2911 $source_chart_type = $args['source_chart_type'];
2912 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
2913 $action = isset($_GET['action']) ? sanitize_text_field(wp_unslash($_GET['action'])) : 'add';
2914
2915 if (isset($source) && !empty($source)) {
2916 if ( !isset( $source[0] ) ) {
2917 if (count($source[1]) > 2) {
2918 $titles = array();
2919 for ($i = 0; $i < count($source[1]); $i++) {
2920 array_push($titles, __("Title", 'chart-builder').$i);
2921 }
2922 $source[0] = $titles;
2923 } else {
2924 $source[0] = array(
2925 __("Country", 'chart-builder'),
2926 __("Population", 'chart-builder'),
2927 );
2928 }
2929
2930 ksort($source);
2931 }
2932 }
2933
2934 if ($action == 'add') {
2935 foreach ($source as $key => $row) {
2936 $source[$key] = array_slice($row, 0, 2);
2937 }
2938 } else if ($action == 'edit') {
2939 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2940 foreach ($source as $key => $row) {
2941 $source[$key] = array_slice($row, 0, 2);
2942 }
2943 }
2944 }
2945 ob_start();
2946 ?>
2947 <div class="ays-accordion-data-main-wrap">
2948 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2949 <?php if($source_chart_type != 'org_chart'): ?>
2950 <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">
2951 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2952 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2953 </div> -->
2954 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2955 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2956 <?php if(!empty($source)):
2957 foreach($source as $source_id => $source_value):
2958 if(!empty($source_value) ):
2959 if ($source_id == 0): ?>
2960 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2961 <div class="ays-chart-empty-data-table-cell"></div>
2962 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2963 <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); ?>">
2964 <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">
2965 <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;" />
2966 </svg>
2967 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2968 <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'" : "" ?>>
2969 <?php if ($each_source_id !== 0): ?>
2970 <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">
2971 <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;" />
2972 </svg>
2973 <?php endif; ?>
2974 </div>
2975 </div>
2976 <?php endforeach; ?>
2977 </div>
2978 <?php else: ?>
2979 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2980 <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">
2981 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2982 <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;" />
2983 </svg>
2984 </div>
2985 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2986 <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">
2987 <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;" />
2988 </svg>
2989 </div>
2990 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2991 <?php if ($each_source_id == 0): ?>
2992 <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); ?>">
2993 <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)); ?>">
2994 </div>
2995 <?php else: ?>
2996 <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); ?>">
2997 <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">
2998 </div>
2999 <?php endif; ?>
3000 <?php endforeach; ?>
3001 </div>
3002 <?php endif; ?>
3003 <?php endif; ?>
3004 <?php endforeach; ?>
3005 <?php else:?>
3006 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
3007 <div style="height: 63.11px; padding: 0 15px;"></div>
3008 <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">
3009 <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">
3010 <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;" />
3011 </svg>
3012 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3013 <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'>
3014 <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">
3015 <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;" />
3016 </svg>
3017 </div>
3018 </div>
3019 </div>
3020 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
3021 <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">
3022 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3023 <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" />
3024 </svg>
3025 </div>
3026 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3027 <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">
3028 <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;" />
3029 </svg>
3030 </div>
3031 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3032 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3033 </div>
3034 <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">
3035 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3036 </div>
3037 </div>
3038 <?php endif; ?>
3039 </div>
3040 <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">
3041 <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">
3042 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3043 </div>
3044 </div>
3045 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3046 <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">
3047 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3048 </div>
3049 <br>
3050 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3051 <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>
3052 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3053 </button>
3054 </div>
3055 <?php endif; ?>
3056 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
3057 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-org-type">
3058 <ul id="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-tree-content">
3059 </ul>
3060 </div>
3061 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3062 <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>
3063 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3064 </button>
3065 </div>
3066 </div>
3067 </div>
3068 <?php
3069 $content = ob_get_clean();
3070
3071 $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") . '">
3072 <i class="ays_fa ays_fa_info_circle"></i>
3073 </a>';
3074
3075 $sources['manual'] = array(
3076 'content' => $content,
3077 'title' => $title
3078 );
3079
3080 return $sources;
3081 }
3082
3083 public function source_contents_manual_settings_chartjs( $sources, $args ){
3084 $html_class_prefix = $args['html_class_prefix'];
3085 $html_name_prefix = $args['html_name_prefix'];
3086 $source = $args['source'];
3087 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
3088 $settings = $args['settings'];
3089 $source_chart_type = $args['source_chart_type'];
3090 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
3091 $action = isset($_GET['action']) ? sanitize_text_field((wp_unslash($_GET['action']))) : 'add';
3092
3093 ob_start();
3094 ?>
3095 <div class="ays-accordion-data-main-wrap">
3096 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
3097 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr($html_class_prefix) ?>chart-source-data-manual">
3098 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
3099 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
3100 <?php if(!empty($source)):
3101 foreach($source as $source_id => $source_value):
3102 if(!empty($source_value) ):
3103 if ($source_id == 0): ?>
3104 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3105 <div class="ays-chart-empty-data-table-cell"></div>
3106 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3107 <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); ?>">
3108 <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">
3109 <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;" />
3110 </svg>
3111 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3112 <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'" : "" ?>>
3113 <?php if ($each_source_id !== 0): ?>
3114 <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">
3115 <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;" />
3116 </svg>
3117 <?php endif; ?>
3118 </div>
3119 </div>
3120 <?php endforeach; ?>
3121 </div>
3122 <?php else: ?>
3123 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3124 <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">
3125 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3126 <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;" />
3127 </svg>
3128 </div>
3129 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
3130 <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">
3131 <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;" />
3132 </svg>
3133 </div>
3134 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3135 <?php if ($each_source_id == 0): ?>
3136 <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); ?>">
3137 <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)); ?>">
3138 </div>
3139 <?php else: ?>
3140 <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); ?>">
3141 <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">
3142 </div>
3143 <?php endif; ?>
3144 <?php endforeach; ?>
3145 </div>
3146 <?php endif; ?>
3147 <?php endif; ?>
3148 <?php endforeach; ?>
3149 <?php else:?>
3150 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
3151 <div style="height: 63.11px; padding: 0 15px;"></div>
3152 <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">
3153 <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">
3154 <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;" />
3155 </svg>
3156 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3157 <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'>
3158 <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">
3159 <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;" />
3160 </svg>
3161 </div>
3162 </div>
3163 </div>
3164 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
3165 <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">
3166 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3167 <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" />
3168 </svg>
3169 </div>
3170 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3171 <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">
3172 <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;" />
3173 </svg>
3174 </div>
3175 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3176 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3177 </div>
3178 <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">
3179 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3180 </div>
3181 </div>
3182 <?php endif; ?>
3183 </div>
3184 <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">
3185 <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">
3186 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3187 </div>
3188 </div>
3189 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3190 <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">
3191 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3192 </div>
3193 <br>
3194 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3195 <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>
3196 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3197 </button>
3198 </div>
3199 </div>
3200 </div>
3201 <?php
3202 $content = ob_get_clean();
3203
3204 $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") . '">
3205 <i class="ays_fa ays_fa_info_circle"></i>
3206 </a>';
3207
3208 $sources['manual'] = array(
3209 'content' => $content,
3210 'title' => $title
3211 );
3212
3213 return $sources;
3214 }
3215
3216 /**
3217 * Chart page settings contents
3218 * @param $args
3219 */
3220 public function ays_chart_page_settings_contents( $args ){
3221 $chart_source_type = $args['chart_source_type'];
3222
3223 if ($chart_source_type === 'chart-js') {
3224 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
3225 } else {
3226 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
3227 }
3228
3229 $sources = array();
3230 foreach ( $sources_contents as $key => $sources_content ) {
3231 $collapsed = $key == 'general_settings' ? 'false' : 'true';
3232
3233 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
3234 if(isset($sources_content['title'])){
3235 $content .= '<legend class="ays-accordion-options-header">';
3236 $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">
3237 <g>
3238 <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" />
3239 </g>
3240 </svg>';
3241
3242 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
3243 }
3244
3245 $content .= '<div class="ays-accordion-options-content">';
3246 $content .= $sources_content['content'];
3247 $content .= '</div>';
3248
3249 $content .= '</fieldset>';
3250
3251 $sources[] = $content;
3252 }
3253 $content_for_escape = implode('' , $sources );
3254 echo html_entity_decode( $content_for_escape );
3255 }
3256
3257 public function settings_contents_general_settings( $sources, $args ){
3258 $html_class_prefix = $args['html_class_prefix'];
3259 $html_name_prefix = $args['html_name_prefix'];
3260 $chart_description = $args['chart_description'];
3261 $create_author_data = $args['create_author_data'];
3262 $status = $args['status'];
3263 $settings = $args['settings'];
3264
3265 $show_title = $settings['show_title'];
3266 $show_description = $settings['show_description'];
3267 $enable_interactivity = $settings['enable_interactivity'];
3268 $maximized_view = $settings['maximized_view'];
3269
3270 ob_start();
3271 ?>
3272 <div class="ays-accordion-data-main-wrap">
3273 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3274 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3275 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3276 <label for="ays-status" class="form-label">
3277 <?php echo esc_html(__('Status', "chart-builder")); ?>
3278 <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") ); ?>">
3279 <i class="ays_fa ays_fa_info_circle"></i>
3280 </a>
3281 </label>
3282 </div>
3283 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3284 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3285 <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' : ''; ?> >
3286 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3287 </label>
3288 </div>
3289 </div> <!-- Status -->
3290 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3291 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3292 <label for="ays-chart-description" class="form-label">
3293 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3294 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3295 <i class="ays_fa ays_fa_info_circle"></i>
3296 </a>
3297 </label>
3298 </div>
3299 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3300 <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>
3301 </div>
3302 </div> <!-- Chart description -->
3303 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3304 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3305 <label for="ays-chart-create-author" class="form-label">
3306 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3307 <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")); ?>">
3308 <i class="ays_fa ays_fa_info_circle"></i>
3309 </a>
3310 </label>
3311 </div>
3312 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3313 <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">
3314 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3315 <?php if (isset($create_author_data['ID'])) : ?>
3316 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3317 <?php endif; ?>
3318 </select>
3319 </div>
3320 </div> <!-- Change chart author -->
3321 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3322 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3323 <label for="ays-chart-show-title" class="form-label">
3324 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3325 <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") ); ?>">
3326 <i class="ays_fa ays_fa_info_circle"></i>
3327 </a>
3328 </label>
3329 </div>
3330 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3331 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3332 <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); ?> >
3333 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3334 </label>
3335 </div>
3336 </div> <!-- Show title -->
3337 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3338 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3339 <label for="ays-chart-show-description" class="form-label">
3340 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3341 <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") ); ?>">
3342 <i class="ays_fa ays_fa_info_circle"></i>
3343 </a>
3344 </label>
3345 </div>
3346 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3347 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3348 <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); ?> >
3349 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3350 </label>
3351 </div>
3352 </div> <!-- Show description -->
3353 <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">
3354 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3355 <label for="ays-chart-option-enable-interactivity" class="form-label">
3356 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3357 <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") ); ?>">
3358 <i class="ays_fa ays_fa_info_circle"></i>
3359 </a>
3360 </label>
3361 </div>
3362 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3363 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3364 <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); ?> >
3365 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3366 </label>
3367 </div>
3368 </div> <!-- Enable interactivity -->
3369 <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">
3370 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3371 <label for="ays-chart-option-maximized-view" class="form-label">
3372 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3373 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3374 <i class="ays_fa ays_fa_info_circle"></i>
3375 </a>
3376 </label>
3377 </div>
3378 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3379 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3380 <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); ?> >
3381 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3382 </label>
3383 </div>
3384 </div> <!-- Maximized view -->
3385 </div>
3386 </div>
3387 <?php
3388 $content = ob_get_clean();
3389
3390 $title = __( 'General Settings', "chart-builder" );
3391
3392 $sources['general_settings'] = array(
3393 'content' => $content,
3394 'title' => $title
3395 );
3396
3397 return $sources;
3398 }
3399
3400 public function settings_contents_general_settings_chartjs( $sources, $args ){
3401 $html_class_prefix = $args['html_class_prefix'];
3402 $html_name_prefix = $args['html_name_prefix'];
3403 $chart_description = $args['chart_description'];
3404 $create_author_data = $args['create_author_data'];
3405 $status = $args['status'];
3406 $settings = $args['settings'];
3407
3408 $show_title = $settings['show_title'];
3409 $show_description = $settings['show_description'];
3410
3411 ob_start();
3412 ?>
3413 <div class="ays-accordion-data-main-wrap">
3414 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3415 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3416 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3417 <label for="ays-status" class="form-label">
3418 <?php echo esc_html(__('Status', "chart-builder")); ?>
3419 <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") ); ?>">
3420 <i class="ays_fa ays_fa_info_circle"></i>
3421 </a>
3422 </label>
3423 </div>
3424 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3425 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3426 <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' : ''; ?> >
3427 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3428 </label>
3429 </div>
3430 </div> <!-- Status -->
3431 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3432 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3433 <label for="ays-chart-description" class="form-label">
3434 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3435 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3436 <i class="ays_fa ays_fa_info_circle"></i>
3437 </a>
3438 </label>
3439 </div>
3440 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3441 <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>
3442 </div>
3443 </div> <!-- Chart description -->
3444 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3445 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3446 <label for="ays-chart-create-author" class="form-label">
3447 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3448 <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")); ?>">
3449 <i class="ays_fa ays_fa_info_circle"></i>
3450 </a>
3451 </label>
3452 </div>
3453 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3454 <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">
3455 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3456 <?php if (isset($create_author_data['ID'])) : ?>
3457 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3458 <?php endif; ?>
3459 </select>
3460 </div>
3461 </div> <!-- Change chart author -->
3462 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3463 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3464 <label for="ays-chart-show-title" class="form-label">
3465 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3466 <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") ); ?>">
3467 <i class="ays_fa ays_fa_info_circle"></i>
3468 </a>
3469 </label>
3470 </div>
3471 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3472 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3473 <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); ?> >
3474 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3475 </label>
3476 </div>
3477 </div> <!-- Show title -->
3478 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3479 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3480 <label for="ays-chart-show-description" class="form-label">
3481 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3482 <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") ); ?>">
3483 <i class="ays_fa ays_fa_info_circle"></i>
3484 </a>
3485 </label>
3486 </div>
3487 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3488 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3489 <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); ?> >
3490 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3491 </label>
3492 </div>
3493 </div> <!-- Show description -->
3494 </div>
3495 </div>
3496 <?php
3497 $content = ob_get_clean();
3498
3499 $title = __( 'General Settings', "chart-builder" );
3500
3501 $sources['general_settings'] = array(
3502 'content' => $content,
3503 'title' => $title
3504 );
3505
3506 return $sources;
3507 }
3508
3509 public function settings_contents_tooltip_settings( $sources, $args ){
3510 $html_class_prefix = $args['html_class_prefix'];
3511 $html_name_prefix = $args['html_name_prefix'];
3512 $settings = $args['settings'];
3513
3514 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3515 $tooltip_trigger = $settings['tooltip_trigger'];
3516 $show_color_code = $settings['show_color_code'];
3517 $tooltip_italic = $settings['tooltip_italic'];
3518 $tooltip_bold = $settings['tooltip_bold'];
3519 $tooltip_bold_options = $settings['tooltip_bold_options'];
3520 $tooltip_text_color = $settings['tooltip_text_color'];
3521 $tooltip_font_size = $settings['tooltip_font_size'];
3522
3523 ob_start();
3524 ?>
3525 <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">
3526 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3527 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3528 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3529 <label for="ays-chart-option-tooltip-trigger">
3530 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3531 <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") )); ?>">
3532 <i class="ays_fa ays_fa_info_circle"></i>
3533 </a>
3534 </label>
3535 </div>
3536 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3537 <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]">
3538 <?php
3539 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3540 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3541 ?>
3542 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3543 <?php
3544 endforeach;
3545 ?>
3546 </select>
3547 </div>
3548 </div> <!-- Trigger -->
3549 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3550 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3551 <label for="ays-chart-option-show-color-code">
3552 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3553 <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") ); ?>">
3554 <i class="ays_fa ays_fa_info_circle"></i>
3555 </a>
3556 </label>
3557 </div>
3558 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3559 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3560 <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); ?> >
3561 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3562 </label>
3563 </div>
3564 </div> <!-- Show Color Code -->
3565 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3566 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3567 <label for="ays-chart-option-tooltip-text-color">
3568 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3569 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3570 <i class="ays_fa ays_fa_info_circle"></i>
3571 </a>
3572 </label>
3573 </div>
3574 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3575 <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) ?>">
3576 </div>
3577 </div> <!-- Text color -->
3578 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3579 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3580 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3581 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3582 <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") )); ?>">
3583 <i class="ays_fa ays_fa_info_circle"></i>
3584 </a>
3585 </label>
3586 </div>
3587 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3588 <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) ?>">
3589 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3590 </div>
3591 </div> <!-- Font size -->
3592 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3593 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3594 <label for="ays-chart-option-tooltip-italic">
3595 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3596 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3597 <i class="ays_fa ays_fa_info_circle"></i>
3598 </a>
3599 </label>
3600 </div>
3601 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3602 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3603 <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); ?> >
3604 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3605 </label>
3606 </div>
3607 </div> <!-- Italic text -->
3608 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3609 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3610 <label for="ays-chart-option-tooltip-bold">
3611 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3612 <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") )); ?>">
3613 <i class="ays_fa ays_fa_info_circle"></i>
3614 </a>
3615 </label>
3616 </div>
3617 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3618 <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]">
3619 <?php
3620 foreach ( $tooltip_bold_options as $option_slug => $option ):
3621 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3622 ?>
3623 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3624 <?php
3625 endforeach;
3626 ?>
3627 </select>
3628 </div>
3629 </div> <!-- Bold text -->
3630 </div>
3631 </div>
3632 <?php
3633 $content = ob_get_clean();
3634
3635 $title = __( 'Tooltip', "chart-builder" );
3636
3637 $sources['tooltip'] = array(
3638 'content' => $content,
3639 'title' => $title
3640 );
3641
3642 return $sources;
3643 }
3644
3645 public function settings_contents_legend_settings( $sources, $args ){
3646 $html_class_prefix = $args['html_class_prefix'];
3647 $html_name_prefix = $args['html_name_prefix'];
3648 $settings = $args['settings'];
3649 $legend_positions = $settings['legend_positions'];
3650 $legend_position = $settings['legend_position'];
3651 $legend_alignments = $settings['legend_alignments'];
3652 $legend_alignment = $settings['legend_alignment'];
3653 $legend_color = $settings['legend_color'];
3654 $legend_font_size = $settings['legend_font_size'];
3655 $legend_bold = $settings['legend_bold'];
3656 $legend_italic = $settings['legend_italic'];
3657
3658 ob_start();
3659 ?>
3660 <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">
3661 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3662 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3663 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3664 <label for="ays-chart-option-legend-position">
3665 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3666 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
3667 <i class="ays_fa ays_fa_info_circle"></i>
3668 </a>
3669 </label>
3670 </div>
3671 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3672 <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]">
3673 <?php
3674 foreach ( $legend_positions as $option_slug => $option ):
3675 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3676
3677 $type_class = '';
3678 if ($option_slug == 'left') {
3679 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3680 } else if ($option_slug == 'in') {
3681 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3682 } else if ($option_slug == 'labeled') {
3683 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3684 }
3685
3686 ?>
3687
3688 <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>
3689 <?php
3690 endforeach;
3691 ?>
3692 </select>
3693 </div>
3694 </div> <!-- Legend position -->
3695 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3696 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3697 <label for="ays-chart-option-legend-alignment">
3698 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3699 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
3700 <i class="ays_fa ays_fa_info_circle"></i>
3701 </a>
3702 </label>
3703 </div>
3704 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3705 <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]">
3706 <?php
3707 foreach ( $legend_alignments as $option_slug => $option ):
3708 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3709 ?>
3710 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3711 <?php
3712 endforeach;
3713 ?>
3714 </select>
3715 </div>
3716 </div> <!-- Legend alignment -->
3717 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3718 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3719 <label for="ays-chart-option-legend-font-color">
3720 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3721 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") )); ?>">
3722 <i class="ays_fa ays_fa_info_circle"></i>
3723 </a>
3724 </label>
3725 </div>
3726 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3727 <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) ?>">
3728 </div>
3729 </div> <!-- Legend font color -->
3730 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3731 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3732 <label for="ays-chart-option-legend-font-size" class="form-label">
3733 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3734 <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") )); ?>">
3735 <i class="ays_fa ays_fa_info_circle"></i>
3736 </a>
3737 </label>
3738 </div>
3739 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3740 <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) ?>">
3741 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3742 </div>
3743 </div> <!-- Font size -->
3744 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3745 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3746 <label for="ays-chart-option-legend-italic">
3747 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3748 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3749 <i class="ays_fa ays_fa_info_circle"></i>
3750 </a>
3751 </label>
3752 </div>
3753 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3754 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3755 <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); ?> >
3756 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3757 </label>
3758 </div>
3759 </div> <!-- Italic text -->
3760 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3761 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3762 <label for="ays-chart-option-legend-bold">
3763 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3764 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3765 <i class="ays_fa ays_fa_info_circle"></i>
3766 </a>
3767 </label>
3768 </div>
3769 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3770 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3771 <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); ?> >
3772 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3773 </label>
3774 </div>
3775 </div> <!-- Bold text -->
3776 </div>
3777 </div>
3778 <?php
3779 $content = ob_get_clean();
3780
3781 $title = __( 'Legend', "chart-builder" );
3782
3783 $sources['legend'] = array(
3784 'content' => $content,
3785 'title' => $title
3786 );
3787
3788 return $sources;
3789 }
3790
3791 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3792 $html_class_prefix = $args['html_class_prefix'];
3793 $html_name_prefix = $args['html_name_prefix'];
3794 $settings = $args['settings'];
3795
3796 $haxis_title = $settings['haxis_title'];
3797 $axes_text_positions = $settings['axes_text_positions'];
3798 $haxis_text_position = $settings['haxis_text_position'];
3799 $haxis_direction = $settings['haxis_direction'];
3800 $haxis_text_color = $settings['haxis_text_color'];
3801 $haxis_baseline_color = $settings['haxis_baseline_color'];
3802 $haxis_slanted_options = $settings['haxis_slanted_options'];
3803 $haxis_slanted = $settings['haxis_slanted'];
3804 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3805 $haxis_show_text_every = $settings['haxis_show_text_every'];
3806 $haxis_format_options = $settings['axes_format_options'];
3807 $haxis_format = $settings['haxis_format'];
3808 $haxis_enable_divide_percent = $settings['haxis_enable_divide_percent'];
3809 $haxis_label_font_size = $settings['haxis_label_font_size'];
3810 $haxis_max_value = $settings['haxis_max_value'];
3811 $haxis_min_value = $settings['haxis_min_value'];
3812 $haxis_text_font_size = $settings['haxis_text_font_size'];
3813 $haxis_label_color = $settings['haxis_label_color'];
3814 $haxis_bold = $settings['haxis_bold'];
3815 $haxis_italic = $settings['haxis_italic'];
3816 $haxis_title_bold = $settings['haxis_title_bold'];
3817 $haxis_title_italic = $settings['haxis_title_italic'];
3818 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3819 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3820 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3821
3822 ob_start();
3823 ?>
3824 <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">
3825 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3826 <h6>Label</h6>
3827 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3828 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3829 <label for="ays-chart-option-haxis-title" class="form-label">
3830 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3831 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the horizontal axis","chart-builder") ); ?>">
3832 <i class="ays_fa ays_fa_info_circle"></i>
3833 </a>
3834 </label>
3835 </div>
3836 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3837 <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) ?>">
3838 </div>
3839 </div> <!-- Horizontal axis label -->
3840 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3841 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3842 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3843 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3844 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3845 <i class="ays_fa ays_fa_info_circle"></i>
3846 </a>
3847 </label>
3848 </div>
3849 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3850 <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) ?>">
3851 </div>
3852 </div> <!-- Horizontal axis label font size -->
3853 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3854 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3855 <label for="ays-chart-option-haxis-label-color">
3856 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3857 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3858 <i class="ays_fa ays_fa_info_circle"></i>
3859 </a>
3860 </label>
3861 </div>
3862 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3863 <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) ?>">
3864 </div>
3865 </div> <!-- Horizontal axis label color -->
3866 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3867 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3868 <label for="ays-chart-option-haxis-title-italic">
3869 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3870 <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") ); ?>">
3871 <i class="ays_fa ays_fa_info_circle"></i>
3872 </a>
3873 </label>
3874 </div>
3875 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3876 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3877 <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); ?> >
3878 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3879 </label>
3880 </div>
3881 </div> <!-- Italic label -->
3882 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3883 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3884 <label for="ays-chart-option-haxis-title-bold">
3885 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3886 <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") ); ?>">
3887 <i class="ays_fa ays_fa_info_circle"></i>
3888 </a>
3889 </label>
3890 </div>
3891 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3892 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3893 <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); ?> >
3894 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3895 </label>
3896 </div>
3897 </div> <!-- Bold label -->
3898 <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">
3899 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3900 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3901 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3902 <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") ); ?>">
3903 <i class="ays_fa ays_fa_info_circle"></i>
3904 </a>
3905 </label>
3906 </div>
3907 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3908 <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">
3909 </div>
3910 </div> <!-- Label interval -->
3911
3912 <br>
3913 <h6>Text</h6>
3914 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3915 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3916 <label for="ays-chart-option-haxis-text-position" class="form-label">
3917 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3918 <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") ); ?>">
3919 <i class="ays_fa ays_fa_info_circle"></i>
3920 </a>
3921 </label>
3922 </div>
3923 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3924 <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]">
3925 <?php
3926 foreach ( $axes_text_positions as $option_slug => $option ):
3927 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3928 ?>
3929 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3930 <?php
3931 endforeach;
3932 ?>
3933 </select>
3934 </div>
3935 </div> <!-- Horizontal axis text position -->
3936 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3937 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3938 <label for="ays-chart-option-haxis-text-color">
3939 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3940 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
3941 <i class="ays_fa ays_fa_info_circle"></i>
3942 </a>
3943 </label>
3944 </div>
3945 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3946 <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) ?>">
3947 </div>
3948 </div> <!-- Horizontal axis text color -->
3949 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3950 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3951 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
3952 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3953 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
3954 <i class="ays_fa ays_fa_info_circle"></i>
3955 </a>
3956 </label>
3957 </div>
3958 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3959 <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) ?>">
3960 </div>
3961 </div> <!-- Horizontal axis text font size -->
3962 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3963 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3964 <label for="ays-chart-option-haxis-text-direction">
3965 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3966 <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") ); ?>">
3967 <i class="ays_fa ays_fa_info_circle"></i>
3968 </a>
3969 </label>
3970 </div>
3971 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3972 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3973 <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); ?> >
3974 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3975 </label>
3976 </div>
3977 </div> <!-- Horizontal axis text direction -->
3978 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3979 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3980 <label for="ays-chart-option-haxis-italic">
3981 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3982 <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") ); ?>">
3983 <i class="ays_fa ays_fa_info_circle"></i>
3984 </a>
3985 </label>
3986 </div>
3987 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3988 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3989 <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); ?> >
3990 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3991 </label>
3992 </div>
3993 </div> <!-- Italic text -->
3994 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3995 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3996 <label for="ays-chart-option-haxis-bold">
3997 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3998 <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") ); ?>">
3999 <i class="ays_fa ays_fa_info_circle"></i>
4000 </a>
4001 </label>
4002 </div>
4003 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4004 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4005 <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); ?> >
4006 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4007 </label>
4008 </div>
4009 </div> <!-- Bold text -->
4010 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4011 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4012 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
4013 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
4014 <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") ); ?>">
4015 <i class="ays_fa ays_fa_info_circle"></i>
4016 </a>
4017 </label>
4018 </div>
4019 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4020 <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]">
4021 <?php
4022 foreach ( $haxis_slanted_options as $option_slug => $option ):
4023 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
4024 ?>
4025 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4026 <?php
4027 endforeach;
4028 ?>
4029 </select>
4030 </div>
4031 </div> <!-- Horizontal axis slanted text -->
4032 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
4033 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4034 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
4035 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
4036 <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") ); ?>">
4037 <i class="ays_fa ays_fa_info_circle"></i>
4038 </a>
4039 </label>
4040 </div>
4041 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4042 <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">
4043 </div>
4044 </div> <!-- Horizontal axis slanted text angle -->
4045
4046 <br>
4047 <h6>Gridlines</h6>
4048 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4049 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4050 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
4051 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4052 <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") ); ?>">
4053 <i class="ays_fa ays_fa_info_circle"></i>
4054 </a>
4055 </label>
4056 </div>
4057 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4058 <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) ?>">
4059 </div>
4060 </div> <!-- Horizontal axis gridlines count -->
4061 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4062 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4063 <label for="ays-chart-option-haxis-gridlines-color">
4064 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4065 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
4066 <i class="ays_fa ays_fa_info_circle"></i>
4067 </a>
4068 </label>
4069 </div>
4070 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4071 <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) ?>">
4072 </div>
4073 </div> <!-- Horizontal axis gridlines color -->
4074 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4075 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4076 <label for="ays-chart-option-haxis-minor-gridlines-color">
4077 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4078 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
4079 <i class="ays_fa ays_fa_info_circle"></i>
4080 </a>
4081 </label>
4082 </div>
4083 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4084 <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) ?>">
4085 </div>
4086 </div> <!-- Horizontal axis minor gridlines color -->
4087 <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">
4088 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4089 <label for="ays-chart-option-haxis-baseline-color">
4090 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4091 <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") ); ?>">
4092 <i class="ays_fa ays_fa_info_circle"></i>
4093 </a>
4094 </label>
4095 </div>
4096 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4097 <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) ?>">
4098 </div>
4099 </div> <!-- Horizontal axis baseline color -->
4100
4101 <br class="cb-changable-opt cb-bar_chart-opt " >
4102 <h6 class="cb-changable-opt cb-bar_chart-opt">Format</h6>
4103 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt " >
4104 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4105 <label for="ays-chart-option-haxis-format" class="form-label">
4106 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4107 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4108 echo esc_attr( sprintf(
4109 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4110 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4111 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4112 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4113 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4114 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4115 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4116 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4117 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4118 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4119 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4120 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4121 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4122 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4123 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4124 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4125 '<em>', '</em>',
4126 '<em>', '</em>',
4127 '<em>', '</em>',
4128 '<em>', '</em>',
4129 '<em>', '</em>',
4130 '<em>', '</em>',
4131 '<em>', '</em>'
4132 ));
4133 ?>">
4134 <i class="ays_fa ays_fa_info_circle"></i>
4135 </a>
4136 </label>
4137 </div>
4138 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4139 <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]">
4140 <?php
4141 foreach ( $haxis_format_options as $option_slug => $option ):
4142 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
4143 ?>
4144 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4145 <?php
4146 endforeach;
4147 ?>
4148 </select>
4149 </div>
4150 </div> <!-- Horizontal axis format -->
4151 <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;'; ?>">
4152 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4153 <label for="ays-chart-option-haxis-enable-divide-percent">
4154 <?php echo esc_html(__( "Remove Extra Zeros ", "chart-builder" )); ?>
4155 <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") ); ?>">
4156 <i class="ays_fa ays_fa_info_circle"></i>
4157 </a>
4158 </label>
4159 </div>
4160 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4161 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4162 <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); ?> >
4163 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4164 </label>
4165 </div>
4166 </div> <!--Remove Extra Zeros"-->
4167 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt" >
4168 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4169 <label for="ays-chart-option-haxis-max-value" class="form-label">
4170 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4171 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4172 <i class="ays_fa ays_fa_info_circle"></i>
4173 </a>
4174 </label>
4175 </div>
4176 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4177 <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) ?>">
4178 </div>
4179 </div> <!-- Horizontal axis max value -->
4180 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt" >
4181 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4182 <label for="ays-chart-option-haxis-min-value" class="form-label">
4183 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4184 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4185 <i class="ays_fa ays_fa_info_circle"></i>
4186 </a>
4187 </label>
4188 </div>
4189 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4190 <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) ?>">
4191 </div>
4192 </div> <!-- Horizontal axis min value -->
4193 </div>
4194 </div>
4195 <?php
4196 $content = ob_get_clean();
4197
4198 $title = __( 'Horizontal Axis Settings', "chart-builder" );
4199
4200 $sources['horizontal_axis'] = array(
4201 'content' => $content,
4202 'title' => $title
4203 );
4204
4205 return $sources;
4206 }
4207
4208 public function settings_contents_vertical_axis_settings( $sources, $args ){
4209 $html_class_prefix = $args['html_class_prefix'];
4210 $html_name_prefix = $args['html_name_prefix'];
4211 $settings = $args['settings'];
4212
4213 $vaxis_title = $settings['vaxis_title'];
4214 $axes_text_positions = $settings['axes_text_positions'];
4215 $vaxis_text_position = $settings['vaxis_text_position'];
4216 $vaxis_direction = $settings['vaxis_direction'];
4217 $vaxis_text_color = $settings['vaxis_text_color'];
4218 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
4219 $vaxis_format_options = $settings['axes_format_options'];
4220 $vaxis_format = $settings['vaxis_format'];
4221 $vaxis_enable_divide_percent = $settings['vaxis_enable_divide_percent'];
4222 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
4223 $vaxis_max_value = $settings['vaxis_max_value'];
4224 $vaxis_min_value = $settings['vaxis_min_value'];
4225 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
4226 $vaxis_label_color = $settings['vaxis_label_color'];
4227 $vaxis_bold = $settings['vaxis_bold'];
4228 $vaxis_italic = $settings['vaxis_italic'];
4229 $vaxis_title_bold = $settings['vaxis_title_bold'];
4230 $vaxis_title_italic = $settings['vaxis_title_italic'];
4231 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
4232 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
4233 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
4234
4235 ob_start();
4236 ?>
4237 <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">
4238 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4239 <h6>Label</h6>
4240 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4241 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4242 <label for="ays-chart-option-vaxis-title" class="form-label">
4243 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
4244 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the vertical axis","chart-builder") ); ?>">
4245 <i class="ays_fa ays_fa_info_circle"></i>
4246 </a>
4247 </label>
4248 </div>
4249 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4250 <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) ?>">
4251 </div>
4252 </div> <!-- Vertical axis label -->
4253 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4254 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4255 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
4256 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4257 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
4258 <i class="ays_fa ays_fa_info_circle"></i>
4259 </a>
4260 </label>
4261 </div>
4262 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4263 <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) ?>">
4264 </div>
4265 </div> <!-- Vertical axis label font size -->
4266 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4267 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4268 <label for="ays-chart-option-vaxis-label-color">
4269 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4270 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
4271 <i class="ays_fa ays_fa_info_circle"></i>
4272 </a>
4273 </label>
4274 </div>
4275 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4276 <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) ?>">
4277 </div>
4278 </div> <!-- Vertical axis label color -->
4279 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4280 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4281 <label for="ays-chart-option-vaxis-title-italic">
4282 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4283 <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") ); ?>">
4284 <i class="ays_fa ays_fa_info_circle"></i>
4285 </a>
4286 </label>
4287 </div>
4288 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4289 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4290 <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); ?> >
4291 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4292 </label>
4293 </div>
4294 </div> <!-- Italic label -->
4295 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4296 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4297 <label for="ays-chart-option-vaxis-title-bold">
4298 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4299 <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") ); ?>">
4300 <i class="ays_fa ays_fa_info_circle"></i>
4301 </a>
4302 </label>
4303 </div>
4304 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4305 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4306 <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); ?> >
4307 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4308 </label>
4309 </div>
4310 </div> <!-- Bold label -->
4311
4312 <br>
4313 <h6>Text</h6>
4314 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4315 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4316 <label for="ays-chart-option-vaxis-text-position" class="form-label">
4317 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4318 <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") ); ?>">
4319 <i class="ays_fa ays_fa_info_circle"></i>
4320 </a>
4321 </label>
4322 </div>
4323 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4324 <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]">
4325 <?php
4326 foreach ( $axes_text_positions as $option_slug => $option ):
4327 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
4328 ?>
4329 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4330 <?php
4331 endforeach;
4332 ?>
4333 </select>
4334 </div>
4335 </div> <!-- Vertical axis text position -->
4336 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4337 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4338 <label for="ays-chart-option-vaxis-text-color">
4339 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4340 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
4341 <i class="ays_fa ays_fa_info_circle"></i>
4342 </a>
4343 </label>
4344 </div>
4345 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4346 <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) ?>">
4347 </div>
4348 </div> <!-- Vertical axis text color -->
4349 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4350 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4351 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4352 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4353 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4354 <i class="ays_fa ays_fa_info_circle"></i>
4355 </a>
4356 </label>
4357 </div>
4358 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4359 <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) ?>">
4360 </div>
4361 </div> <!-- Vertical axis text font size -->
4362 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4363 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4364 <label for="ays-chart-option-vaxis-text-direction">
4365 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4366 <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") ); ?>">
4367 <i class="ays_fa ays_fa_info_circle"></i>
4368 </a>
4369 </label>
4370 </div>
4371 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4372 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4373 <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); ?> >
4374 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4375 </label>
4376 </div>
4377 </div> <!-- Vertical axis text direction -->
4378 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4379 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4380 <label for="ays-chart-option-vaxis-italic">
4381 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4382 <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") ); ?>">
4383 <i class="ays_fa ays_fa_info_circle"></i>
4384 </a>
4385 </label>
4386 </div>
4387 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4388 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4389 <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); ?> >
4390 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4391 </label>
4392 </div>
4393 </div> <!-- Italic text -->
4394 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4395 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4396 <label for="ays-chart-option-vaxis-bold">
4397 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4398 <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") ); ?>">
4399 <i class="ays_fa ays_fa_info_circle"></i>
4400 </a>
4401 </label>
4402 </div>
4403 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4404 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4405 <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); ?> >
4406 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4407 </label>
4408 </div>
4409 </div> <!-- Bold text -->
4410
4411 <br>
4412 <h6>Gridlines</h6>
4413 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4414 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4415 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
4416 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4417 <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") ); ?>">
4418 <i class="ays_fa ays_fa_info_circle"></i>
4419 </a>
4420 </label>
4421 </div>
4422 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4423 <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) ?>">
4424 </div>
4425 </div> <!-- Vertical axis gridlines count -->
4426 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4427 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4428 <label for="ays-chart-option-vaxis-gridlines-color">
4429 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4430 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4431 <i class="ays_fa ays_fa_info_circle"></i>
4432 </a>
4433 </label>
4434 </div>
4435 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4436 <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) ?>">
4437 </div>
4438 </div> <!-- Vertical axis gridlines color -->
4439 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4440 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4441 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4442 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4443 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4444 <i class="ays_fa ays_fa_info_circle"></i>
4445 </a>
4446 </label>
4447 </div>
4448 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4449 <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) ?>">
4450 </div>
4451 </div> <!-- Vertical axis minor gridlines color -->
4452 <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">
4453 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4454 <label for="ays-chart-option-vaxis-baseline-color">
4455 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4456 <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") ); ?>">
4457 <i class="ays_fa ays_fa_info_circle"></i>
4458 </a>
4459 </label>
4460 </div>
4461 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4462 <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) ?>">
4463 </div>
4464 </div> <!-- Vertical axis baseline color -->
4465
4466 <br class="cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
4467 <h6 class="cb-changable-opt cb-column_chart-opt cb-line_chart-opt">Format</h6>
4468 <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">
4469 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4470 <label for="ays-chart-option-vaxis-format" class="form-label">
4471 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4472 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4473 echo esc_attr( sprintf(
4474 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4475 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4476 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4477 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4478 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4479 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4480 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4481 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4482 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4483 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4484 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4485 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4486 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4487 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4488 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4489 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4490 '<em>', '</em>',
4491 '<em>', '</em>',
4492 '<em>', '</em>',
4493 '<em>', '</em>',
4494 '<em>', '</em>',
4495 '<em>', '</em>',
4496 '<em>', '</em>'
4497 ));
4498 ?>">
4499 <i class="ays_fa ays_fa_info_circle"></i>
4500 </a>
4501 </label>
4502 </div>
4503 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4504 <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]">
4505 <?php
4506 foreach ( $vaxis_format_options as $option_slug => $option ):
4507 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4508 ?>
4509 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4510 <?php
4511 endforeach;
4512 ?>
4513 </select>
4514 </div>
4515 </div> <!-- Vertical axis format -->
4516 <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;'; ?>">
4517 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4518 <label for="ays-chart-option-vaxis-enable-divide-percent">
4519 <?php echo esc_html(__( "Remove Extra Zeros", "chart-builder" )); ?>
4520 <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") ); ?>">
4521 <i class="ays_fa ays_fa_info_circle"></i>
4522 </a>
4523 </label>
4524 </div>
4525 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4526 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4527 <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); ?> >
4528 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4529 </label>
4530 </div>
4531 </div> <!--Remove Extra Zeros-->
4532 <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">
4533 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4534 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4535 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4536 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4537 <i class="ays_fa ays_fa_info_circle"></i>
4538 </a>
4539 </label>
4540 </div>
4541 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4542 <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) ?>">
4543 </div>
4544 </div> <!-- Vertical axis max value -->
4545 <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">
4546 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4547 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4548 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4549 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4550 <i class="ays_fa ays_fa_info_circle"></i>
4551 </a>
4552 </label>
4553 </div>
4554 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4555 <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) ?>">
4556 </div>
4557 </div> <!-- Vertical axis min value -->
4558 </div>
4559 </div>
4560 <?php
4561 $content = ob_get_clean();
4562
4563 $title = __( 'Vertical Axis Settings', "chart-builder" );
4564
4565 $sources['vertical_axis'] = array(
4566 'content' => $content,
4567 'title' => $title
4568 );
4569
4570 return $sources;
4571 }
4572
4573 public function settings_contents_animation_settings( $sources, $args ) {
4574 $html_class_prefix = $args['html_class_prefix'];
4575 $html_name_prefix = $args['html_name_prefix'];
4576 $settings = $args['settings'];
4577
4578 $enable_animation = $settings['enable_animation'];
4579 $animation_duration = $settings['animation_duration'];
4580 $animation_startup = $settings['animation_startup'];
4581 $animation_easing_options = $settings['animation_easing_options'];
4582 $animation_easing = $settings['animation_easing'];
4583
4584 ob_start();
4585 ?>
4586 <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">
4587 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4588 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4589 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4590 <label for="ays-chart-option-enable-animation">
4591 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4592 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4593 <i class="ays_fa ays_fa_info_circle"></i>
4594 </a>
4595 </label>
4596 </div>
4597 <div class="col-sm-7 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 <?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); ?> >
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> <!-- Enable animation -->
4604 <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'; ?>">
4605 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4606 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4607 <label for="ays-chart-option-animation-duration" class="form-label">
4608 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4609 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4610 <i class="ays_fa ays_fa_info_circle"></i>
4611 </a>
4612 </label>
4613 </div>
4614 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4615 <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) ?>">
4616 </div>
4617 </div> <!-- Animation duration -->
4618 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4619 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4620 <label for="ays-chart-option-animation-startup">
4621 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4622 <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") ); ?>">
4623 <i class="ays_fa ays_fa_info_circle"></i>
4624 </a>
4625 </label>
4626 </div>
4627 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4628 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4629 <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); ?> >
4630 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4631 </label>
4632 </div>
4633 </div> <!-- Animation startup -->
4634 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4635 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4636 <label for="ays-chart-option-animation-easing" class="form-label">
4637 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4638 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4639 echo esc_attr( sprintf(
4640 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4641 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4642 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4643 __('%1$sLinear:%2$s Constant speed.', "chart-builder") . "</li><li>" .
4644 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4645 __('%1$sEase in:%2$s Start slow and speed up.', "chart-builder") . "</li><li>" .
4646 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4647 __('%1$sEase out:%2$s Start fast and slow down.', "chart-builder") . "</li><li>" .
4648 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4649 __('%1$sEase in and out:%2$s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4650 '<em>', '</em>',
4651 '<em>', '</em>',
4652 '<em>', '</em>',
4653 '<em>', '</em>'
4654 ));
4655 ?>">
4656 <i class="ays_fa ays_fa_info_circle"></i>
4657 </a>
4658 </label>
4659 </div>
4660 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4661 <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]">
4662 <?php
4663 foreach ( $animation_easing_options as $option_slug => $option ):
4664 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4665 ?>
4666 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4667 <?php
4668 endforeach;
4669 ?>
4670 </select>
4671 </div>
4672 </div> <!-- Animation easing -->
4673 <div>
4674 </div>
4675 </div>
4676 <?php
4677 $content = ob_get_clean();
4678
4679 $title = __( 'Chart animation', "chart-builder" );
4680
4681 $sources['animation'] = array(
4682 'content' => $content,
4683 'title' => $title
4684 );
4685
4686 return $sources;
4687 }
4688
4689 public function settings_contents_live_chart_settings( $sources, $args ) {
4690 $html_class_prefix = $args['html_class_prefix'];
4691 $html_name_prefix = $args['html_name_prefix'];
4692
4693 ob_start();
4694 ?>
4695 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-live-chart-settings-tab">
4696 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4697 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4698 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4699 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4700 <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>
4701 <div class="ays-pro-features-v2-video-text">
4702 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4703 </div>
4704 </a>
4705 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4706 <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>
4707 <div class="ays-pro-features-v2-upgrade-text">
4708 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4709 </div>
4710 </a>
4711 </div>
4712 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4713 <label for="ays-chart-option-enable-live-chart">
4714 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4715 <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") ); ?>">
4716 <i class="ays_fa ays_fa_info_circle"></i>
4717 </a>
4718 </label>
4719 </div>
4720 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4721 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4722 <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">
4723 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4724 </label>
4725 </div>
4726 </div> <!-- Enable live chart -->
4727 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4728 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4729 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4730 <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>
4731 <div class="ays-pro-features-v2-video-text">
4732 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4733 </div>
4734 </a>
4735 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4736 <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>
4737 <div class="ays-pro-features-v2-upgrade-text">
4738 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4739 </div>
4740 </a>
4741 </div>
4742 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4743 <label for="ays-chart-option-live-chart-interval" class="form-label">
4744 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4745 <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") ); ?>">
4746 <i class="ays_fa ays_fa_info_circle"></i>
4747 </a>
4748 </label>
4749 </div>
4750 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4751 <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">
4752 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4753 </div>
4754 </div> <!-- Live chart interval -->
4755 </div>
4756 </div>
4757 <?php
4758 $content = ob_get_clean();
4759
4760 $title = __( 'Live Chart', "chart-builder" );
4761
4762 $sources['live_chart'] = array(
4763 'content' => $content,
4764 'title' => $title
4765 );
4766
4767 return $sources;
4768
4769 }
4770
4771 public function settings_contents_export_options( $sources, $args ){
4772 $html_class_prefix = $args['html_class_prefix'];
4773 $html_name_prefix = $args['html_name_prefix'];
4774 $settings = $args['settings'];
4775
4776 $enable_img = $settings['enable_img'];
4777
4778 ob_start();
4779 ?>
4780 <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">
4781 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4782 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4783 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4784 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4785 <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>
4786 <div class="ays-pro-features-v2-video-text">
4787 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4788 </div>
4789 </a>
4790 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4791 <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>
4792 <div class="ays-pro-features-v2-upgrade-text">
4793 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4794 </div>
4795 </a>
4796 </div>
4797 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4798 <label for="ays-chart-option-export-print">
4799 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4800 <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") ); ?>">
4801 <i class="ays_fa ays_fa_info_circle"></i>
4802 </a>
4803 </label>
4804 </div>
4805 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4806 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4807 <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">
4808 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4809 </label>
4810 </div>
4811 </div> <!-- Print option end -->
4812 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4813 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4814 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4815 <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>
4816 <div class="ays-pro-features-v2-video-text">
4817 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4818 </div>
4819 </a>
4820 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4821 <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>
4822 <div class="ays-pro-features-v2-upgrade-text">
4823 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4824 </div>
4825 </a>
4826 </div>
4827 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4828 <label for="ays-chart-option-export-Excel">
4829 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4830 <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") ); ?>">
4831 <i class="ays_fa ays_fa_info_circle"></i>
4832 </a>
4833 </label>
4834 </div>
4835 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4836 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4837 <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">
4838 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4839 </label>
4840 </div>
4841 </div> <!-- Excel option end -->
4842 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4843 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4844 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4845 <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>
4846 <div class="ays-pro-features-v2-video-text">
4847 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4848 </div>
4849 </a>
4850 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4851 <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>
4852 <div class="ays-pro-features-v2-upgrade-text">
4853 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4854 </div>
4855 </a>
4856 </div>
4857 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4858 <label for="ays-chart-option-export-CSV">
4859 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4860 <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") ); ?>">
4861 <i class="ays_fa ays_fa_info_circle"></i>
4862 </a>
4863 </label>
4864 </div>
4865 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4866 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4867 <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">
4868 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4869 </label>
4870 </div>
4871 </div> <!-- CSV option end -->
4872 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4873 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4874 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4875 <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>
4876 <div class="ays-pro-features-v2-video-text">
4877 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4878 </div>
4879 </a>
4880 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4881 <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>
4882 <div class="ays-pro-features-v2-upgrade-text">
4883 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4884 </div>
4885 </a>
4886 </div>
4887 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4888 <label for="ays-chart-option-export-Copy">
4889 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4890 <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") ); ?>">
4891 <i class="ays_fa ays_fa_info_circle"></i>
4892 </a>
4893 </label>
4894 </div>
4895 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4896 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4897 <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">
4898 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4899 </label>
4900 </div>
4901 </div> <!-- Copy option end -->
4902 <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">
4903 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4904 <label for="ays-chart-option-export-img">
4905 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4906 <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") ); ?>">
4907 <i class="ays_fa ays_fa_info_circle"></i>
4908 </a>
4909 </label>
4910 </div>
4911 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4912 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4913 <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)?> >
4914 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4915 </label>
4916 </div>
4917 </div> <!-- IMG option end -->
4918 </div>
4919 </div>
4920 <?php
4921
4922 $content = ob_get_clean();
4923
4924 $title = __( 'Frontend Actions', "chart-builder" );
4925
4926 $sources['export_options'] = array(
4927 'content' => $content,
4928 'title' => $title
4929 );
4930
4931 return $sources;
4932 }
4933
4934 /**
4935 * Chart page styles contents
4936 * @param $args
4937 */
4938 public function ays_chart_page_styles_contents( $args ){
4939 $chart_source_type = $args['chart_source_type'];
4940
4941 if ($chart_source_type === 'chart-js') {
4942 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4943 } else {
4944 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4945 }
4946
4947 $sources = array();
4948 foreach ( $sources_contents as $key => $sources_content ) {
4949 $collapsed = $key == 'chart' ? 'false' : 'true';
4950
4951 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4952 if(isset($sources_content['title'])){
4953 $content .= '<legend class="ays-accordion-options-header">';
4954 $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">
4955 <g>
4956 <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" />
4957 </g>
4958 </svg>';
4959
4960 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4961 }
4962
4963 $content .= '<div class="ays-accordion-options-content">';
4964 $content .= $sources_content['content'];
4965 $content .= '</div>';
4966
4967 $content .= '</fieldset>';
4968
4969 $sources[] = $content;
4970 }
4971 $content_for_escape = implode('' , $sources );
4972 echo html_entity_decode( esc_html($content_for_escape) );
4973 }
4974
4975 public function settings_contents_chart_styles_settings( $sources, $args ){
4976 $html_class_prefix = $args['html_class_prefix'];
4977 $html_name_prefix = $args['html_name_prefix'];
4978 $settings = $args['settings'];
4979
4980 $width = $settings['width'];
4981 $width_format = $settings['width_format'];
4982 $title_positions = $settings['title_positions'];
4983 $position = $settings['position'];
4984 $width_format_options = $settings['width_format_options'];
4985 $responsive_width = $settings['responsive_width'];
4986 $height = $settings['height'];
4987 $height_format = $settings['height_format'];
4988 $font_size = $settings['font_size'];
4989 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4990 $org_chart_font_size = $settings['org_chart_font_size'];
4991 $background_color = $settings['background_color'];
4992 $transparent_background = $settings['transparent_background'];
4993 $border_width = $settings['border_width'];
4994 $border_width_with_title = $settings['border_width_with_title'];
4995 $border_radius_with_title = $settings['border_radius_with_title'];
4996 $border_color_with_title = $settings['border_color_with_title'];
4997 $border_style_with_title = $settings['border_style_with_title'];
4998 $border_style = $settings['border_style'];
4999 $border_styles = $settings['border_styles'];
5000 $border_radius = $settings['border_radius'];
5001 $border_color = $settings['border_color'];
5002 $box_shadow = $settings['box_shadow'];
5003 $box_shadow_color = $settings['box_shadow_color'];
5004 $padding_outer = $settings['padding_outer'];
5005 ob_start();
5006 ?>
5007 <div class="ays-accordion-data-main-wrap">
5008 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5009 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5010 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5011 <label for="ays-chart-option-width" class="form-label">
5012 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
5013 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container, in percents.","chart-builder") ); ?>">
5014 <i class="ays_fa ays_fa_info_circle"></i>
5015 </a>
5016 </label>
5017 </div>
5018 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5019 <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) ?>">
5020 <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]">
5021 <?php
5022 foreach ( $width_format_options as $option_slug => $option ):
5023 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
5024 ?>
5025 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5026 <?php
5027 endforeach;
5028 ?>
5029 </select>
5030 </div>
5031 </div> <!-- Width -->
5032 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5033 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5034 <label for="ays-chart-option-responsive-width" class="form-label">
5035 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
5036 <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") ); ?>">
5037 <i class="ays_fa ays_fa_info_circle"></i>
5038 </a>
5039 </label>
5040 </div>
5041 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5042 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5043 <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); ?> >
5044 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5045 </label>
5046 </div>
5047 </div> <!-- Responsive Width -->
5048 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5049 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5050 <label for="ays-chart-option-position">
5051 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5052 <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") ); ?>">
5053 <i class="ays_fa ays_fa_info_circle"></i>
5054 </a>
5055 </label>
5056 </div>
5057 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5058 <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]">
5059 <?php
5060 foreach ( $title_positions as $option_slug => $option ):
5061 $selected = ( $position == $option_slug ) ? 'selected' : '';
5062 ?>
5063 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5064 <?php
5065 endforeach;
5066 ?>
5067 </select>
5068 </div>
5069 </div> <!-- Position -->
5070 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5071 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5072 <label for="ays-chart-option-height" class="form-label">
5073 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
5074 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
5075 <i class="ays_fa ays_fa_info_circle"></i>
5076 </a>
5077 </label>
5078 </div>
5079 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5080 <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) ?>">
5081 <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]">
5082 <?php
5083 foreach ( $width_format_options as $option_slug => $option ):
5084 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
5085 ?>
5086 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5087 <?php
5088 endforeach;
5089 ?>
5090 </select>
5091 </div>
5092 </div> <!-- Height -->
5093 <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">
5094 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5095 <label for="ays-chart-option-font-size" class="form-label">
5096 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5097 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart text.","chart-builder") ); ?>">
5098 <i class="ays_fa ays_fa_info_circle"></i>
5099 </a>
5100 </label>
5101 </div>
5102 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5103 <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) ?>">
5104 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5105 </div>
5106 </div> <!-- Font size -->
5107 <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">
5108 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5109 <label for="ays-chart-option-org-chart-font-size" class="form-label">
5110 <?php echo esc_html(__( "Element size", 'chart-builder' )); ?>
5111 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The size of the chart element.","chart-builder") ); ?>">
5112 <i class="ays_fa ays_fa_info_circle"></i>
5113 </a>
5114 </label>
5115 </div>
5116 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5117 <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]">
5118 <?php
5119 foreach ( $org_chart_font_size_options as $option_slug => $option ):
5120 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
5121 ?>
5122 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_attr($option); ?></option>
5123 <?php
5124 endforeach;
5125 ?>
5126 </select>
5127 </div>
5128 </div> <!-- Font size for org type -->
5129 <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">
5130 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5131 <label for="ays-chart-option-background-color">
5132 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5133 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart container.","chart-builder") ); ?>">
5134 <i class="ays_fa ays_fa_info_circle"></i>
5135 </a>
5136 </label>
5137 </div>
5138 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5139 <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) ?>">
5140 </div>
5141 </div> <!-- Background color -->
5142 <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">
5143 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5144 <label for="ays-chart-option-transparent-background" class="form-label">
5145 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
5146 <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") ); ?>">
5147 <i class="ays_fa ays_fa_info_circle"></i>
5148 </a>
5149 </label>
5150 </div>
5151 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5152 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5153 <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); ?> >
5154 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5155 </label>
5156 </div>
5157 </div> <!-- Transparent background -->
5158 <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">
5159 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5160 <label for="ays-chart-option-border-width">
5161 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5162 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5163 <i class="ays_fa ays_fa_info_circle"></i>
5164 </a>
5165 </label>
5166 </div>
5167 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5168 <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) ?>">
5169 </div>
5170 </div> <!-- Border Width -->
5171 <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">
5172 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5173 <label for="ays-chart-option-border-color">
5174 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5175 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5176 <i class="ays_fa ays_fa_info_circle"></i>
5177 </a>
5178 </label>
5179 </div>
5180 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5181 <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) ?>">
5182 </div>
5183 </div> <!-- Border color -->
5184 <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">
5185 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5186 <label for="ays-chart-option-border-radius">
5187 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5188 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border radius of the chart container.","chart-builder") ); ?>">
5189 <i class="ays_fa ays_fa_info_circle"></i>
5190 </a>
5191 </label>
5192 </div>
5193 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5194 <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) ?>">
5195 </div>
5196 </div> <!-- Border radius -->
5197 <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">
5198 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5199 <label for="ays-chart-option-border-style">
5200 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5201 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5202 <i class="ays_fa ays_fa_info_circle"></i>
5203 </a>
5204 </label>
5205 </div>
5206 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5207 <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]">
5208 <?php
5209 foreach ( $border_styles as $option_slug => $option ):
5210 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5211 ?>
5212 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5213 <?php
5214 endforeach;
5215 ?>
5216 </select>
5217 </div>
5218 </div> <!-- Border style -->
5219 <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">
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-option-box-shadow" class="form-label">
5222 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5223 <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") ); ?>">
5224 <i class="ays_fa ays_fa_info_circle"></i>
5225 </a>
5226 </label>
5227 </div>
5228 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5229 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5230 <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); ?> >
5231 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5232 </label>
5233 </div>
5234 </div> <!-- box shadow -->
5235 <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">
5236 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5237 <label for="ays-chart-option-box-shadow-color" class="form-label">
5238 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5239 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5240 <i class="ays_fa ays_fa_info_circle"></i>
5241 </a>
5242 </label>
5243 </div>
5244 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5245 <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) ?>">
5246 </div>
5247 </div> <!-- box shadow color -->
5248 <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">
5249 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5250 <label for="ays-chart-option-border-width-with-title">
5251 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5252 <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") ); ?>">
5253 <i class="ays_fa ays_fa_info_circle"></i>
5254 </a>
5255 </label>
5256 </div>
5257 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5258 <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) ?>">
5259 </div>
5260 </div> <!-- Border Width with title -->
5261 <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">
5262 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5263 <label for="ays-chart-option-border-radius-with-title">
5264 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
5265 <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") ); ?>">
5266 <i class="ays_fa ays_fa_info_circle"></i>
5267 </a>
5268 </label>
5269 </div>
5270 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5271 <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) ?>">
5272 </div>
5273 </div> <!-- Border radius with title -->
5274 <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">
5275 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5276 <label for="ays-chart-option-border-color-with-title">
5277 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
5278 <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") ); ?>">
5279 <i class="ays_fa ays_fa_info_circle"></i>
5280 </a>
5281 </label>
5282 </div>
5283 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5284 <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) ?>">
5285 </div>
5286 </div> <!-- Border color with title -->
5287 <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">
5288 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5289 <label for="ays-chart-option-border-style-with-title">
5290 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
5291 <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") ); ?>">
5292 <i class="ays_fa ays_fa_info_circle"></i>
5293 </a>
5294 </label>
5295 </div>
5296 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5297 <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]">
5298 <?php
5299 foreach ( $border_styles as $option_slug => $option ):
5300 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
5301 ?>
5302 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5303 <?php
5304 endforeach;
5305 ?>
5306 </select>
5307 </div>
5308 </div> <!-- Border style with title -->
5309 <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">
5310 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5311 <label for="ays-chart-option-padding-outer">
5312 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
5313 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
5314 <i class="ays_fa ays_fa_info_circle"></i>
5315 </a>
5316 </label>
5317 </div>
5318 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5319 <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) ?>">
5320 </div>
5321 </div> <!-- Padding outer -->
5322 </div>
5323 </div>
5324 <?php
5325 $content = ob_get_clean();
5326
5327 $title = __( 'Chart', "chart-builder" );
5328
5329 $sources['chart'] = array(
5330 'content' => $content,
5331 'title' => $title
5332 );
5333
5334 return $sources;
5335 }
5336
5337 public function settings_contents_chart_styles_settings_chartjs( $sources, $args ){
5338 $html_class_prefix = $args['html_class_prefix'];
5339 $html_name_prefix = $args['html_name_prefix'];
5340 $settings = $args['settings'];
5341 $border_width_with_title = $settings['border_width_with_title'];
5342 $border_radius_with_title = $settings['border_radius_with_title'];
5343 $border_width = $settings['border_width'];
5344 $border_radius = $settings['border_radius'];
5345 $border_color = $settings['border_color'];
5346 $background_color_chart = $settings['background_color_chart'];
5347 $border_style = $settings['border_style'];
5348 $border_styles = $settings['border_styles'];
5349 $box_shadow = $settings['box_shadow'];
5350 $box_shadow_color = $settings['box_shadow_color'];
5351 ob_start();
5352 ?>
5353 <div class="ays-accordion-data-main-wrap">
5354 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5355 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5356 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5357 <label for="ays-chart-option-border-width">
5358 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5359 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5360 <i class="ays_fa ays_fa_info_circle"></i>
5361 </a>
5362 </label>
5363 </div>
5364 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5365 <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) ?>">
5366 </div>
5367 </div> <!-- Border Width -->
5368 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5369 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5370 <label for="ays-chart-option-border-radius">
5371 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5372 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border.","chart-builder") ); ?>">
5373 <i class="ays_fa ays_fa_info_circle"></i>
5374 </a>
5375 </label>
5376 </div>
5377 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5378 <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) ?>">
5379 </div>
5380 </div> <!-- Border Radius -->
5381 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5382 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5383 <label for="ays-chart-option-border-color">
5384 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5385 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5386 <i class="ays_fa ays_fa_info_circle"></i>
5387 </a>
5388 </label>
5389 </div>
5390 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5391 <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) ?>">
5392 </div>
5393 </div> <!-- Border color -->
5394 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5395 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5396 <label for="ays-chart-option-border-style">
5397 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5398 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5399 <i class="ays_fa ays_fa_info_circle"></i>
5400 </a>
5401 </label>
5402 </div>
5403 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5404 <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]">
5405 <?php
5406 foreach ( $border_styles as $option_slug => $option ):
5407 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5408 ?>
5409 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5410 <?php
5411 endforeach;
5412 ?>
5413 </select>
5414 </div>
5415 </div> <!-- Border style -->
5416 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5417 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5418 <label for="ays-chart-option-backgorund-color">
5419 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5420 <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") ); ?>">
5421 <i class="ays_fa ays_fa_info_circle"></i>
5422 </a>
5423 </label>
5424 </div>
5425 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5426 <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) ?>">
5427 </div>
5428 </div><!-- Background color -->
5429
5430 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5431 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5432 <label for="ays-chart-option-box-shadow" class="form-label">
5433 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5434 <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") ); ?>">
5435 <i class="ays_fa ays_fa_info_circle"></i>
5436 </a>
5437 </label>
5438 </div>
5439 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5440 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5441 <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); ?> >
5442 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5443 </label>
5444 </div>
5445 </div> <!-- box shadow -->
5446 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5447 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5448 <label for="ays-chart-option-box-shadow-color" class="form-label">
5449 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5450 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5451 <i class="ays_fa ays_fa_info_circle"></i>
5452 </a>
5453 </label>
5454 </div>
5455 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5456 <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) ?>">
5457 </div>
5458 </div> <!-- box shadow color -->
5459 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5460 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5461 <label for="ays-chart-option-border-width-with-title">
5462 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5463 <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") ); ?>">
5464 <i class="ays_fa ays_fa_info_circle"></i>
5465 </a>
5466 </label>
5467 </div>
5468 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5469 <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) ?>">
5470 </div>
5471 </div> <!-- Border Width with title -->
5472 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5473 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5474 <label for="ays-chart-option-border-radius-with-title">
5475 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
5476 <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") ); ?>">
5477 <i class="ays_fa ays_fa_info_circle"></i>
5478 </a>
5479 </label>
5480 </div>
5481 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5482 <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) ?>">
5483 </div>
5484 </div> <!-- Border radius with title -->
5485 </div>
5486 </div>
5487 <?php
5488 $content = ob_get_clean();
5489
5490 $title = __( 'Chart', "chart-builder" );
5491
5492 $sources['chart'] = array(
5493 'content' => $content,
5494 'title' => $title
5495 );
5496
5497 return $sources;
5498 }
5499
5500 public function settings_contents_chart_area_styles_settings( $sources, $args ){
5501 $html_class_prefix = $args['html_class_prefix'];
5502 $html_name_prefix = $args['html_name_prefix'];
5503 $settings = $args['settings'];
5504
5505 $chart_background_color = $settings['chart_background_color'];
5506 $chart_border_color = $settings['chart_border_color'];
5507 $chart_left_margin = $settings['chart_left_margin'];
5508 $chart_right_margin = $settings['chart_right_margin'];
5509 $chart_top_margin = $settings['chart_top_margin'];
5510 $chart_bottom_margin = $settings['chart_bottom_margin'];
5511 $chart_border_width = $settings['chart_border_width'];
5512 ob_start();
5513 ?>
5514 <div class="ays-accordion-data-main-wrap">
5515 <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">
5516 <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">
5517 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5518 <label for="ays-chart-option-chart-background-color">
5519 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5520 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart area.","chart-builder") ); ?>">
5521 <i class="ays_fa ays_fa_info_circle"></i>
5522 </a>
5523 </label>
5524 </div>
5525 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5526 <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) ?>">
5527 </div>
5528 </div> <!-- Chart Area background color -->
5529 <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">
5530 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5531 <label for="ays-chart-option-chart-border-width">
5532 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5533 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border width of the chart area.","chart-builder") ); ?>">
5534 <i class="ays_fa ays_fa_info_circle"></i>
5535 </a>
5536 </label>
5537 </div>
5538 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5539 <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) ?>">
5540 </div>
5541 </div> <!-- Chart Area Border Width -->
5542 <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">
5543 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5544 <label for="ays-chart-option-chart-border-color">
5545 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5546 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart area.","chart-builder") ); ?>">
5547 <i class="ays_fa ays_fa_info_circle"></i>
5548 </a>
5549 </label>
5550 </div>
5551 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5552 <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) ?>">
5553 </div>
5554 </div> <!-- Chart Area border color -->
5555 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5556 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5557 <label for="ays-chart-option-chart-left-margin">
5558 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
5559 <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") ); ?>">
5560 <i class="ays_fa ays_fa_info_circle"></i>
5561 </a>
5562 </label>
5563 </div>
5564 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5565 <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) ?>">
5566 </div>
5567 </div> <!-- Chart Area Left Margin -->
5568 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5569 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5570 <label for="ays-chart-option-chart-right-margin">
5571 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
5572 <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") ); ?>">
5573 <i class="ays_fa ays_fa_info_circle"></i>
5574 </a>
5575 </label>
5576 </div>
5577 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5578 <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) ?>">
5579 </div>
5580 </div> <!-- Chart Area Right Margin -->
5581 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5582 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5583 <label for="ays-chart-option-chart-top-margin">
5584 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
5585 <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") ); ?>">
5586 <i class="ays_fa ays_fa_info_circle"></i>
5587 </a>
5588 </label>
5589 </div>
5590 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5591 <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) ?>">
5592 </div>
5593 </div> <!-- Chart Area Top Margin -->
5594 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5595 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5596 <label for="ays-chart-option-chart-bottom-margin">
5597 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
5598 <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") ); ?>">
5599 <i class="ays_fa ays_fa_info_circle"></i>
5600 </a>
5601 </label>
5602 </div>
5603 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5604 <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) ?>">
5605 </div>
5606 </div> <!-- Chart Area Bottom Margin -->
5607 </div>
5608 </div>
5609 <?php
5610 $content = ob_get_clean();
5611
5612 $title = __( 'Chart Area', "chart-builder" );
5613
5614 $sources['chart_area'] = array(
5615 'content' => $content,
5616 'title' => $title
5617 );
5618
5619 return $sources;
5620 }
5621
5622 public function settings_contents_title_styles_settings( $sources, $args ){
5623 $html_class_prefix = $args['html_class_prefix'];
5624 $html_name_prefix = $args['html_name_prefix'];
5625 $settings = $args['settings'];
5626
5627 $title_color = $settings['title_color'];
5628 $title_shadow_color = $settings['title_shadow_color'];
5629 $title_font_size = $settings['title_font_size'];
5630 $title_gap = $settings['title_gap'];
5631 $title_gap_description = $settings['title_gap_description'];
5632 $title_positions = $settings['title_positions'];
5633 $title_position = $settings['title_position'];
5634 $title_bold = $settings['title_bold'];
5635 $title_text_shadow = $settings['title_text_shadow'];
5636 $title_italic = $settings['title_italic'];
5637 $text_transforms = $settings['text_transforms'];
5638 $text_decorations = $settings['text_decorations'];
5639 $title_text_transform = $settings['title_text_transform'];
5640 $title_text_decoration = $settings['title_text_decoration'];
5641 $title_letter_spacing = $settings['title_letter_spacing'];
5642 ob_start();
5643 ?>
5644 <div class="ays-accordion-data-main-wrap">
5645 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5646 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5647 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5648 <label for="ays-chart-option-title-color">
5649 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5650 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5651 <i class="ays_fa ays_fa_info_circle"></i>
5652 </a>
5653 </label>
5654 </div>
5655 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5656 <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) ?>">
5657 </div>
5658 </div> <!-- Chart title color -->
5659 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5660 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5661 <label for="ays-chart-option-title-font-size" class="form-label">
5662 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5663 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5664 <i class="ays_fa ays_fa_info_circle"></i>
5665 </a>
5666 </label>
5667 </div>
5668 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5669 <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) ?>">
5670 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5671 </div>
5672 </div> <!-- Chart title font size -->
5673 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5674 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5675 <label for="ays-chart-option-title-bold" class="form-label">
5676 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5677 <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") ); ?>">
5678 <i class="ays_fa ays_fa_info_circle"></i>
5679 </a>
5680 </label>
5681 </div>
5682 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5683 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5684 <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); ?> >
5685 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5686 </label>
5687 </div>
5688 </div> <!-- Title bold -->
5689 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5690 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5691 <label for="ays-chart-option-title-italic" class="form-label">
5692 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5693 <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") ); ?>">
5694 <i class="ays_fa ays_fa_info_circle"></i>
5695 </a>
5696 </label>
5697 </div>
5698 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5699 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5700 <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); ?> >
5701 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5702 </label>
5703 </div>
5704 </div> <!-- Title italic -->
5705 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5706 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5707 <label for="ays-chart-option-title-position">
5708 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5709 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5710 <i class="ays_fa ays_fa_info_circle"></i>
5711 </a>
5712 </label>
5713 </div>
5714 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5715 <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]">
5716 <?php
5717 foreach ( $title_positions as $option_slug => $option ):
5718 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5719 ?>
5720 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5721 <?php
5722 endforeach;
5723 ?>
5724 </select>
5725 </div>
5726 </div> <!-- Title position -->
5727 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5728 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5729 <label for="ays-chart-option-title-gap" class="form-label">
5730 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5731 <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") ); ?>">
5732 <i class="ays_fa ays_fa_info_circle"></i>
5733 </a>
5734 </label>
5735 </div>
5736 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5737 <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) ?>">
5738 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5739 </div>
5740 </div> <!-- Chart title gap -->
5741 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5742 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5743 <label for="ays-chart-option-title-gap-description" class="form-label">
5744 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5745 <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") ); ?>">
5746 <i class="ays_fa ays_fa_info_circle"></i>
5747 </a>
5748 </label>
5749 </div>
5750 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5751 <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) ?>">
5752 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5753 </div>
5754 </div> <!-- Chart title gap -->
5755 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5756 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5757 <label for="ays-chart-option-title-text-transform">
5758 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5759 <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") ); ?>">
5760 <i class="ays_fa ays_fa_info_circle"></i>
5761 </a>
5762 </label>
5763 </div>
5764 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5765 <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]">
5766 <?php
5767 foreach ( $text_transforms as $option_slug => $option ):
5768 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5769 ?>
5770 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5771 <?php
5772 endforeach;
5773 ?>
5774 </select>
5775 </div>
5776 </div> <!-- Title text transform -->
5777 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5778 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5779 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5780 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5781 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5782 <i class="ays_fa ays_fa_info_circle"></i>
5783 </a>
5784 </label>
5785 </div>
5786 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5787 <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) ?>">
5788 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5789 </div>
5790 </div> <!-- Chart title letter spacing -->
5791 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5792 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5793 <label for="ays-chart-option-title-text-decoration">
5794 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5795 <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") ); ?>">
5796 <i class="ays_fa ays_fa_info_circle"></i>
5797 </a>
5798 </label>
5799 </div>
5800 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5801 <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]">
5802 <?php
5803 foreach ( $text_decorations as $option_slug => $option ):
5804 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5805 ?>
5806 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5807 <?php
5808 endforeach;
5809 ?>
5810 </select>
5811 </div>
5812 </div> <!-- Title text decoration -->
5813 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5814 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5815 <label for="ays-chart-option-title-text-shadow" class="form-label">
5816 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5817 <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") ); ?>">
5818 <i class="ays_fa ays_fa_info_circle"></i>
5819 </a>
5820 </label>
5821 </div>
5822 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5823 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5824 <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); ?> >
5825 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5826 </label>
5827 </div>
5828 </div> <!-- Title bold -->
5829 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5830 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5831 <label for="ays-chart-option-title-shadow-color">
5832 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5833 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5834 <i class="ays_fa ays_fa_info_circle"></i>
5835 </a>
5836 </label>
5837 </div>
5838 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5839 <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) ?>">
5840 </div>
5841 </div> <!-- Chart title color -->
5842 </div>
5843 </div>
5844 <?php
5845 $content = ob_get_clean();
5846
5847 $title = __( 'Title', "chart-builder" );
5848
5849 $sources['title'] = array(
5850 'content' => $content,
5851 'title' => $title
5852 );
5853
5854 return $sources;
5855 }
5856
5857 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5858 $html_class_prefix = $args['html_class_prefix'];
5859 $html_name_prefix = $args['html_name_prefix'];
5860 $settings = $args['settings'];
5861
5862 $title_color = $settings['title_color'];
5863 $title_shadow_color = $settings['title_shadow_color'];
5864 $title_font_size = $settings['title_font_size'];
5865 $title_gap = $settings['title_gap'];
5866 $title_gap_description = $settings['title_gap_description'];
5867 $title_positions = $settings['title_positions'];
5868 $title_position = $settings['title_position'];
5869 $title_bold = $settings['title_bold'];
5870 $title_text_shadow = $settings['title_text_shadow'];
5871 $title_italic = $settings['title_italic'];
5872 $text_transforms = $settings['text_transforms'];
5873 $text_decorations = $settings['text_decorations'];
5874 $title_text_transform = $settings['title_text_transform'];
5875 $title_text_decoration = $settings['title_text_decoration'];
5876 $title_letter_spacing = $settings['title_letter_spacing'];
5877 ob_start();
5878 ?>
5879 <div class="ays-accordion-data-main-wrap">
5880 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5881 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5882 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5883 <label for="ays-chart-option-title-color">
5884 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5885 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5886 <i class="ays_fa ays_fa_info_circle"></i>
5887 </a>
5888 </label>
5889 </div>
5890 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5891 <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) ?>">
5892 </div>
5893 </div> <!-- Chart title color -->
5894 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5895 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5896 <label for="ays-chart-option-title-font-size" class="form-label">
5897 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5898 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5899 <i class="ays_fa ays_fa_info_circle"></i>
5900 </a>
5901 </label>
5902 </div>
5903 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5904 <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) ?>">
5905 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5906 </div>
5907 </div> <!-- Chart title font size -->
5908 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5909 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5910 <label for="ays-chart-option-title-bold" class="form-label">
5911 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5912 <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") ); ?>">
5913 <i class="ays_fa ays_fa_info_circle"></i>
5914 </a>
5915 </label>
5916 </div>
5917 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5918 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5919 <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); ?> >
5920 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5921 </label>
5922 </div>
5923 </div> <!-- Title bold -->
5924 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5925 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5926 <label for="ays-chart-option-title-italic" class="form-label">
5927 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5928 <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") ); ?>">
5929 <i class="ays_fa ays_fa_info_circle"></i>
5930 </a>
5931 </label>
5932 </div>
5933 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5934 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5935 <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); ?> >
5936 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5937 </label>
5938 </div>
5939 </div> <!-- Title italic -->
5940 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5941 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5942 <label for="ays-chart-option-title-position">
5943 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5944 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5945 <i class="ays_fa ays_fa_info_circle"></i>
5946 </a>
5947 </label>
5948 </div>
5949 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5950 <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]">
5951 <?php
5952 foreach ( $title_positions as $option_slug => $option ):
5953 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5954 ?>
5955 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5956 <?php
5957 endforeach;
5958 ?>
5959 </select>
5960 </div>
5961 </div> <!-- Title position -->
5962 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5963 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5964 <label for="ays-chart-option-title-gap" class="form-label">
5965 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5966 <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") ); ?>">
5967 <i class="ays_fa ays_fa_info_circle"></i>
5968 </a>
5969 </label>
5970 </div>
5971 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5972 <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) ?>">
5973 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5974 </div>
5975 </div> <!-- Chart title gap -->
5976 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5977 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5978 <label for="ays-chart-option-title-gap-description" class="form-label">
5979 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5980 <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") ); ?>">
5981 <i class="ays_fa ays_fa_info_circle"></i>
5982 </a>
5983 </label>
5984 </div>
5985 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5986 <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) ?>">
5987 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5988 </div>
5989 </div> <!-- Chart title gap -->
5990 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5991 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5992 <label for="ays-chart-option-title-text-transform">
5993 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5994 <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") ); ?>">
5995 <i class="ays_fa ays_fa_info_circle"></i>
5996 </a>
5997 </label>
5998 </div>
5999 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6000 <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]">
6001 <?php
6002 foreach ( $text_transforms as $option_slug => $option ):
6003 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
6004 ?>
6005 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6006 <?php
6007 endforeach;
6008 ?>
6009 </select>
6010 </div>
6011 </div> <!-- Title text transform -->
6012 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6013 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6014 <label for="ays-chart-option-title-letter-spacing" class="form-label">
6015 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6016 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
6017 <i class="ays_fa ays_fa_info_circle"></i>
6018 </a>
6019 </label>
6020 </div>
6021 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6022 <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) ?>">
6023 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6024 </div>
6025 </div> <!-- Chart title letter spacing -->
6026 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6027 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6028 <label for="ays-chart-option-title-text-decoration">
6029 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6030 <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") ); ?>">
6031 <i class="ays_fa ays_fa_info_circle"></i>
6032 </a>
6033 </label>
6034 </div>
6035 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6036 <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]">
6037 <?php
6038 foreach ( $text_decorations as $option_slug => $option ):
6039 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
6040 ?>
6041 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6042 <?php
6043 endforeach;
6044 ?>
6045 </select>
6046 </div>
6047 </div> <!-- Title text decoration -->
6048 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6049 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6050 <label for="ays-chart-option-title-text-shadow" class="form-label">
6051 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6052 <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") ); ?>">
6053 <i class="ays_fa ays_fa_info_circle"></i>
6054 </a>
6055 </label>
6056 </div>
6057 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6058 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6059 <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); ?> >
6060 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6061 </label>
6062 </div>
6063 </div> <!-- Title bold -->
6064 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6065 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6066 <label for="ays-chart-option-title-shadow-color">
6067 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6068 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
6069 <i class="ays_fa ays_fa_info_circle"></i>
6070 </a>
6071 </label>
6072 </div>
6073 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6074 <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) ?>">
6075 </div>
6076 </div> <!-- Chart title color -->
6077 </div>
6078 </div>
6079 <?php
6080 $content = ob_get_clean();
6081
6082 $title = __( 'Title', "chart-builder" );
6083
6084 $sources['title'] = array(
6085 'content' => $content,
6086 'title' => $title
6087 );
6088
6089 return $sources;
6090 }
6091
6092 public function settings_contents_description_styles_settings( $sources, $args ){
6093 $html_class_prefix = $args['html_class_prefix'];
6094 $html_name_prefix = $args['html_name_prefix'];
6095 $settings = $args['settings'];
6096
6097 $description_color = $settings['description_color'];
6098 $description_font_size = $settings['description_font_size'];
6099 $title_positions = $settings['title_positions'];
6100 $description_position = $settings['description_position'];
6101 $description_bold = $settings['description_bold'];
6102 $description_text_shadow = $settings['description_text_shadow'];
6103 $description_shadow_color = $settings['description_shadow_color'];
6104 $description_italic = $settings['description_italic'];
6105 $text_transforms = $settings['text_transforms'];
6106 $text_decorations = $settings['text_decorations'];
6107 $description_text_transform = $settings['description_text_transform'];
6108 $description_text_decoration = $settings['description_text_decoration'];
6109 $description_letter_spacing = $settings['description_letter_spacing'];
6110
6111 ob_start();
6112 ?>
6113 <div class="ays-accordion-data-main-wrap">
6114 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6115 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6116 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6117 <label for="ays-chart-option-description-color">
6118 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6119 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6120 <i class="ays_fa ays_fa_info_circle"></i>
6121 </a>
6122 </label>
6123 </div>
6124 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6125 <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) ?>">
6126 </div>
6127 </div> <!-- Chart description color -->
6128 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6129 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6130 <label for="ays-chart-option-description-font-size" class="form-label">
6131 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6132 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6133 <i class="ays_fa ays_fa_info_circle"></i>
6134 </a>
6135 </label>
6136 </div>
6137 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6138 <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) ?>">
6139 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6140 </div>
6141 </div> <!-- Chart description font size -->
6142 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6143 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6144 <label for="ays-chart-option-description-bold" class="form-label">
6145 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6146 <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") ); ?>">
6147 <i class="ays_fa ays_fa_info_circle"></i>
6148 </a>
6149 </label>
6150 </div>
6151 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6152 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6153 <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); ?> >
6154 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6155 </label>
6156 </div>
6157 </div> <!-- Description bold -->
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-description-italic" class="form-label">
6161 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6162 <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") ); ?>">
6163 <i class="ays_fa ays_fa_info_circle"></i>
6164 </a>
6165 </label>
6166 </div>
6167 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6168 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6169 <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); ?> >
6170 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6171 </label>
6172 </div>
6173 </div> <!-- Description italic -->
6174 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6175 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6176 <label for="ays-chart-option-description-position">
6177 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6178 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6179 <i class="ays_fa ays_fa_info_circle"></i>
6180 </a>
6181 </label>
6182 </div>
6183 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6184 <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]">
6185 <?php
6186 foreach ( $title_positions as $option_slug => $option ):
6187 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6188 ?>
6189 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6190 <?php
6191 endforeach;
6192 ?>
6193 </select>
6194 </div>
6195 </div> <!-- Description position -->
6196 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6197 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6198 <label for="ays-chart-option-description-text-transform">
6199 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6200 <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") ); ?>">
6201 <i class="ays_fa ays_fa_info_circle"></i>
6202 </a>
6203 </label>
6204 </div>
6205 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6206 <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]">
6207 <?php
6208 foreach ( $text_transforms as $option_slug => $option ):
6209 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6210 ?>
6211 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6212 <?php
6213 endforeach;
6214 ?>
6215 </select>
6216 </div>
6217 </div> <!-- description text transform -->
6218 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6219 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6220 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6221 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6222 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6223 <i class="ays_fa ays_fa_info_circle"></i>
6224 </a>
6225 </label>
6226 </div>
6227 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6228 <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) ?>">
6229 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6230 </div>
6231 </div> <!-- Chart description letter spacing -->
6232 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6233 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6234 <label for="ays-chart-option-description-text-decoration">
6235 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6236 <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") ); ?>">
6237 <i class="ays_fa ays_fa_info_circle"></i>
6238 </a>
6239 </label>
6240 </div>
6241 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6242 <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]">
6243 <?php
6244 foreach ( $text_decorations as $option_slug => $option ):
6245 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6246 ?>
6247 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6248 <?php
6249 endforeach;
6250 ?>
6251 </select>
6252 </div>
6253 </div> <!-- description text decoration -->
6254 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6255 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6256 <label for="ays-chart-option-description-text-shadow" class="form-label">
6257 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6258 <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") ); ?>">
6259 <i class="ays_fa ays_fa_info_circle"></i>
6260 </a>
6261 </label>
6262 </div>
6263 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6264 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6265 <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); ?> >
6266 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6267 </label>
6268 </div>
6269 </div> <!-- description bold -->
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-description-shadow-color">
6273 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6274 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","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-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) ?>">
6281 </div>
6282 </div> <!-- Chart title color -->
6283 </div>
6284 </div>
6285 <?php
6286 $content = ob_get_clean();
6287
6288 $title = __( 'Description', "chart-builder" );
6289
6290 $sources['description'] = array(
6291 'content' => $content,
6292 'title' => $title
6293 );
6294
6295 return $sources;
6296 }
6297
6298 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
6299 $html_class_prefix = $args['html_class_prefix'];
6300 $html_name_prefix = $args['html_name_prefix'];
6301 $settings = $args['settings'];
6302
6303 $description_color = $settings['description_color'];
6304 $description_font_size = $settings['description_font_size'];
6305 $title_positions = $settings['title_positions'];
6306 $description_position = $settings['description_position'];
6307 $description_bold = $settings['description_bold'];
6308 $description_text_shadow = $settings['description_text_shadow'];
6309 $description_shadow_color = $settings['description_shadow_color'];
6310 $description_italic = $settings['description_italic'];
6311 $text_transforms = $settings['text_transforms'];
6312 $text_decorations = $settings['text_decorations'];
6313 $description_text_transform = $settings['description_text_transform'];
6314 $description_text_decoration = $settings['description_text_decoration'];
6315 $description_letter_spacing = $settings['description_letter_spacing'];
6316
6317 ob_start();
6318 ?>
6319 <div class="ays-accordion-data-main-wrap">
6320 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6321 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6322 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6323 <label for="ays-chart-option-description-color">
6324 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6325 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6326 <i class="ays_fa ays_fa_info_circle"></i>
6327 </a>
6328 </label>
6329 </div>
6330 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6331 <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) ?>">
6332 </div>
6333 </div> <!-- Chart description color -->
6334 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6335 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6336 <label for="ays-chart-option-description-font-size" class="form-label">
6337 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6338 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6339 <i class="ays_fa ays_fa_info_circle"></i>
6340 </a>
6341 </label>
6342 </div>
6343 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6344 <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) ?>">
6345 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6346 </div>
6347 </div> <!-- Chart description font size -->
6348 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6349 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6350 <label for="ays-chart-option-description-bold" class="form-label">
6351 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6352 <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") ); ?>">
6353 <i class="ays_fa ays_fa_info_circle"></i>
6354 </a>
6355 </label>
6356 </div>
6357 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6358 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6359 <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); ?> >
6360 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6361 </label>
6362 </div>
6363 </div> <!-- Description bold -->
6364 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6365 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6366 <label for="ays-chart-option-description-italic" class="form-label">
6367 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6368 <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") ); ?>">
6369 <i class="ays_fa ays_fa_info_circle"></i>
6370 </a>
6371 </label>
6372 </div>
6373 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6374 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6375 <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); ?> >
6376 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6377 </label>
6378 </div>
6379 </div> <!-- Description italic -->
6380 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6381 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6382 <label for="ays-chart-option-description-position">
6383 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6384 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6385 <i class="ays_fa ays_fa_info_circle"></i>
6386 </a>
6387 </label>
6388 </div>
6389 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6390 <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]">
6391 <?php
6392 foreach ( $title_positions as $option_slug => $option ):
6393 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6394 ?>
6395 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6396 <?php
6397 endforeach;
6398 ?>
6399 </select>
6400 </div>
6401 </div> <!-- Description position -->
6402 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6403 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6404 <label for="ays-chart-option-description-text-transform">
6405 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6406 <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") ); ?>">
6407 <i class="ays_fa ays_fa_info_circle"></i>
6408 </a>
6409 </label>
6410 </div>
6411 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6412 <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]">
6413 <?php
6414 foreach ( $text_transforms as $option_slug => $option ):
6415 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6416 ?>
6417 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6418 <?php
6419 endforeach;
6420 ?>
6421 </select>
6422 </div>
6423 </div> <!-- description text transform -->
6424 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6425 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6426 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6427 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6428 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6429 <i class="ays_fa ays_fa_info_circle"></i>
6430 </a>
6431 </label>
6432 </div>
6433 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6434 <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) ?>">
6435 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6436 </div>
6437 </div> <!-- Chart description letter spacing -->
6438 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6439 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6440 <label for="ays-chart-option-description-text-decoration">
6441 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6442 <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") ); ?>">
6443 <i class="ays_fa ays_fa_info_circle"></i>
6444 </a>
6445 </label>
6446 </div>
6447 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6448 <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]">
6449 <?php
6450 foreach ( $text_decorations as $option_slug => $option ):
6451 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6452 ?>
6453 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6454 <?php
6455 endforeach;
6456 ?>
6457 </select>
6458 </div>
6459 </div> <!-- description text decoration -->
6460 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6461 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6462 <label for="ays-chart-option-description-text-shadow" class="form-label">
6463 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6464 <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") ); ?>">
6465 <i class="ays_fa ays_fa_info_circle"></i>
6466 </a>
6467 </label>
6468 </div>
6469 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6470 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6471 <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); ?> >
6472 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6473 </label>
6474 </div>
6475 </div> <!-- description bold -->
6476 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6477 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6478 <label for="ays-chart-option-description-shadow-color">
6479 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6480 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6481 <i class="ays_fa ays_fa_info_circle"></i>
6482 </a>
6483 </label>
6484 </div>
6485 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6486 <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) ?>">
6487 </div>
6488 </div> <!-- Chart title color -->
6489 </div>
6490 </div>
6491 <?php
6492 $content = ob_get_clean();
6493
6494 $title = __( 'Description', "chart-builder" );
6495
6496 $sources['description'] = array(
6497 'content' => $content,
6498 'title' => $title
6499 );
6500
6501 return $sources;
6502 }
6503
6504 /**
6505 * Chart page settings contents
6506 * @param $args
6507 */
6508 public function ays_chart_page_advanced_settings_contents( $args ){
6509 $chart_source_type = $args['chart_source_type'];
6510
6511 if ($chart_source_type === 'chart-js') {
6512 if ($args['source_chart_type'] !== 'pie_chart') {return;}
6513 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
6514 } else {
6515 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
6516 }
6517
6518 $sources = array();
6519 foreach ( $sources_contents as $key => $sources_content ) {
6520 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
6521
6522 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
6523 if(isset($sources_content['title'])){
6524 $content .= '<legend class="ays-accordion-options-header">';
6525 $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">
6526 <g>
6527 <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" />
6528 </g>
6529 </svg>';
6530
6531 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
6532 }
6533
6534 $content .= '<div class="ays-accordion-options-content">';
6535 $content .= $sources_content['content'];
6536 $content .= '</div>';
6537
6538 $content .= '</fieldset>';
6539
6540 $sources[] = $content;
6541 }
6542 $content_for_escape = implode('' , $sources );
6543 echo html_entity_decode( esc_html($content_for_escape) );
6544 }
6545
6546 public function settings_contents_advanced_settings( $sources, $args ){
6547 $html_class_prefix = $args['html_class_prefix'];
6548 $html_name_prefix = $args['html_name_prefix'];
6549 $settings = $args['settings'];
6550 $tab_title = $args['tab_name'];
6551
6552 $rotation_degree = $settings['rotation_degree'];
6553 $reverse_categories = $settings['reverse_categories'];
6554 $slice_border_color = $settings['slice_border_color'];
6555 $slice_texts = $settings['slice_texts'];
6556 $slice_text = $settings['slice_text'];
6557 $tooltip_text_options = $settings['tooltip_text_options'];
6558 $tooltip_text = $settings['tooltip_text'];
6559 $is_stacked = $settings['is_stacked'];
6560 $focus_target_options = $settings['focus_target_options'];
6561 $focus_target = $settings['focus_target'];
6562 $multiple_data_format_options = $settings['multiple_data_format_options'];
6563 $multiple_data_format = $settings['multiple_data_format'];
6564 $opacity = $settings['opacity'];
6565 $group_width = $settings['group_width'];
6566 $group_width_format = $settings['group_width_format'];
6567 $group_width_format_options = $settings['group_width_format_options'];
6568 $line_width = $settings['line_width'];
6569 $data_grouping_limit = $settings['data_grouping_limit'];
6570 $data_grouping_label = $settings['data_grouping_label'];
6571 $data_grouping_color = $settings['data_grouping_color'];
6572 $multiple_selection = $settings['multiple_selection'];
6573 $point_shape_options = $settings['point_shape_options'];
6574 $point_shape = $settings['point_shape'];
6575 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
6576 $crosshair_trigger = $settings['crosshair_trigger'];
6577 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
6578 $crosshair_orientation = $settings['crosshair_orientation'];
6579 $crosshair_opacity = $settings['crosshair_opacity'];
6580 $dash_style = $settings['dash_style'];
6581 $point_size = $settings['point_size'];
6582 $donut_hole_size = $settings['donut_hole_size'];
6583 $orientation = $settings['orientation'];
6584 $fill_nulls = $settings['fill_nulls'];
6585 $allow_collapse = $settings['allow_collapse'];
6586 $org_classname = $settings['org_classname'];
6587 $org_node_background_color = $settings['org_node_background_color'];
6588 $org_node_padding = $settings['org_node_padding'];
6589 $org_node_border_radius = $settings['org_node_border_radius'];
6590 $org_node_border_width = $settings['org_node_border_width'];
6591 $org_node_border_color = $settings['org_node_border_color'];
6592 $org_node_text_color = $settings['org_node_text_color'];
6593 $org_node_text_font_size = $settings['org_node_text_font_size'];
6594 $org_node_description_font_color = $settings['org_node_description_font_color'];
6595 $org_node_description_font_size = $settings['org_node_description_font_size'];
6596 $org_selected_classname = $settings['org_selected_classname'];
6597 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
6598 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
6599
6600 ob_start();
6601 ?>
6602 <div class="ays-accordion-data-main-wrap">
6603 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6604 <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">
6605 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6606 <label for="ays-chart-option-rotation-degree" class="form-label">
6607 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
6608 <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") ); ?>">
6609 <i class="ays_fa ays_fa_info_circle"></i>
6610 </a>
6611 </label>
6612 </div>
6613 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6614 <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) ?>">
6615 </div>
6616 </div> <!-- Rotation degree -->
6617 <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">
6618 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6619 <label for="ays-chart-option-reverse-categories">
6620 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
6621 <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") ); ?>">
6622 <i class="ays_fa ays_fa_info_circle"></i>
6623 </a>
6624 </label>
6625 </div>
6626 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6627 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6628 <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); ?> >
6629 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6630 </label>
6631 </div>
6632 </div> <!-- Reverse Categories -->
6633 <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">
6634 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6635 <label for="ays-chart-option-slice-border-color">
6636 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
6637 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
6638 <i class="ays_fa ays_fa_info_circle"></i>
6639 </a>
6640 </label>
6641 </div>
6642 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6643 <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) ?>">
6644 </div>
6645 </div> <!-- Slice border color -->
6646 <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">
6647 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6648 <label for="ays-chart-option-slice-text">
6649 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6650 <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") ); ?>">
6651 <i class="ays_fa ays_fa_info_circle"></i>
6652 </a>
6653 </label>
6654 </div>
6655 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6656 <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]">
6657 <?php
6658 foreach ( $slice_texts as $option_slug => $option ):
6659 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6660 ?>
6661 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6662 <?php
6663 endforeach;
6664 ?>
6665 </select>
6666 </div>
6667 </div> <!-- Slice text -->
6668 <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">
6669 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6670 <label for="ays-chart-option-tooltip-text">
6671 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6672 <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") ); ?>">
6673 <i class="ays_fa ays_fa_info_circle"></i>
6674 </a>
6675 </label>
6676 </div>
6677 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6678 <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]">
6679 <?php
6680 foreach ( $tooltip_text_options as $option_slug => $option ):
6681 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6682 ?>
6683 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6684 <?php
6685 endforeach;
6686 ?>
6687 </select>
6688 </div>
6689 </div> <!-- Slice tooltip Text -->
6690 <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">
6691 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6692 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6693 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6694 <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") ); ?>">
6695 <i class="ays_fa ays_fa_info_circle"></i>
6696 </a>
6697 </label>
6698 </div>
6699 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6700 <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">
6701 </div>
6702 </div> <!-- Data Grouping Limit -->
6703 <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">
6704 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6705 <label for="ays-chart-option-data-grouping-label" class="form-label">
6706 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6707 <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") ); ?>">
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 <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) ?>">
6714 </div>
6715 </div> <!-- Data Grouping Label -->
6716 <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">
6717 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6718 <label for="ays-chart-option-data-grouping-color">
6719 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6720 <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") ); ?>">
6721 <i class="ays_fa ays_fa_info_circle"></i>
6722 </a>
6723 </label>
6724 </div>
6725 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6726 <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) ?>">
6727 </div>
6728 </div> <!-- Data Grouping Color -->
6729 <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">
6730 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6731 <label for="ays-chart-option-is-stacked">
6732 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6733 <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") ); ?>">
6734 <i class="ays_fa ays_fa_info_circle"></i>
6735 </a>
6736 </label>
6737 </div>
6738 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6739 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6740 <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); ?> >
6741 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6742 </label>
6743 </div>
6744 </div> <!-- Is stacked -->
6745 <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">
6746 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6747 <label for="ays-chart-option-focus-target">
6748 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6749 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6750 echo esc_html( sprintf(
6751 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6752 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6753 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6754 __('%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>" .
6755 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6756 __('%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>",
6757 '<em>', '</em>',
6758 '<em>', '</em>'
6759 ));
6760 ?>">
6761 <i class="ays_fa ays_fa_info_circle"></i>
6762 </a>
6763 </label>
6764 </div>
6765 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6766 <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]">
6767 <?php
6768 foreach ( $focus_target_options as $option_slug => $option ):
6769 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6770 ?>
6771 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6772 <?php
6773 endforeach;
6774 ?>
6775 </select>
6776 </div>
6777 </div> <!-- Focus target -->
6778 <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">
6779 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6780 <label for="ays-chart-option-opacity" class="form-label">
6781 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6782 <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") ); ?>">
6783 <i class="ays_fa ays_fa_info_circle"></i>
6784 </a>
6785 </label>
6786 </div>
6787 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6788 <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">
6789 </div>
6790 </div> <!-- Data opacity -->
6791 <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">
6792 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6793 <label for="ays-chart-option-group-width">
6794 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6795 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6796 echo esc_html( sprintf(
6797 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6798 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6799 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6800 __('%1$sPixels:%2$s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6801 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6802 __('%1$sPercentage:%2$s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6803 '<em>', '</em>',
6804 '<em>', '</em>'
6805 ));
6806 ?>">
6807 <i class="ays_fa ays_fa_info_circle"></i>
6808 </a>
6809 </label>
6810 </div>
6811 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6812 <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) ?>">
6813 <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]">
6814 <?php
6815 foreach ( $group_width_format_options as $option_slug => $option ):
6816 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6817 ?>
6818 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6819 <?php
6820 endforeach;
6821 ?>
6822 </select>
6823 </div>
6824 </div> <!-- Bars width -->
6825 <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">
6826 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6827 <label for="ays-chart-option-line-width" class="form-label">
6828 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6829 <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") ); ?>">
6830 <i class="ays_fa ays_fa_info_circle"></i>
6831 </a>
6832 </label>
6833 </div>
6834 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6835 <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) ?>">
6836 </div>
6837 </div> <!-- Line width -->
6838 <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">
6839 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6840 <label for="ays-chart-option-multiple-selection">
6841 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6842 <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") ); ?>">
6843 <i class="ays_fa ays_fa_info_circle"></i>
6844 </a>
6845 </label>
6846 </div>
6847 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6848 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6849 <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); ?> >
6850 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6851 </label>
6852 </div>
6853 </div> <!-- Multiple data selection -->
6854 <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">
6855 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6856 <label for="ays-chart-option-multiple-data-format">
6857 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6858 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6859 echo esc_html( sprintf(
6860 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6861 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6862 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6863 __('%1$sCategory:%2$s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6864 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6865 __('%1$sSeries:%2$s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6866 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6867 __('%1$sAuto:%2$s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6868 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6869 __('%1$sNone:%2$s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6870 '<em>', '</em>',
6871 '<em>', '</em>',
6872 '<em>', '</em>',
6873 '<em>', '</em>'
6874 ));
6875 ?>">
6876 <i class="ays_fa ays_fa_info_circle"></i>
6877 </a>
6878 </label>
6879 </div>
6880 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6881 <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]">
6882 <?php
6883 foreach ( $multiple_data_format_options as $option_slug => $option ):
6884 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6885 ?>
6886 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6887 <?php
6888 endforeach;
6889 ?>
6890 </select>
6891 </div>
6892 </div> <!-- Multiple data format -->
6893 <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">
6894 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6895 <label for="ays-chart-option-point-shape">
6896 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6897 <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") ); ?>">
6898 <i class="ays_fa ays_fa_info_circle"></i>
6899 </a>
6900 </label>
6901 </div>
6902 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6903 <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]">
6904 <?php
6905 foreach ( $point_shape_options as $option_slug => $option ):
6906 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6907 ?>
6908 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6909 <?php
6910 endforeach;
6911 ?>
6912 </select>
6913 </div>
6914 </div> <!-- Point shape -->
6915 <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">
6916 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6917 <label for="ays-chart-option-point-size" class="form-label">
6918 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6919 <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") ); ?>">
6920 <i class="ays_fa ays_fa_info_circle"></i>
6921 </a>
6922 </label>
6923 </div>
6924 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6925 <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) ?>">
6926 </div>
6927 </div> <!-- Point size -->
6928 <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">
6929 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6930 <label for="ays-chart-option-orientation">
6931 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6932 <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") ); ?>">
6933 <i class="ays_fa ays_fa_info_circle"></i>
6934 </a>
6935 </label>
6936 </div>
6937 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6938 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6939 <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); ?> >
6940 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6941 </label>
6942 </div>
6943 </div> <!-- Orientation -->
6944 <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">
6945 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6946 <label for="ays-chart-option-fill-nulls">
6947 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6948 <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") ); ?>">
6949 <i class="ays_fa ays_fa_info_circle"></i>
6950 </a>
6951 </label>
6952 </div>
6953 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6954 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6955 <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); ?> >
6956 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6957 </label>
6958 </div>
6959 </div> <!-- Autofill nulls -->
6960 <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">
6961 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6962 <label for="ays-chart-option-crosshair-trigger">
6963 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6964 <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") ); ?>">
6965 <i class="ays_fa ays_fa_info_circle"></i>
6966 </a>
6967 </label>
6968 </div>
6969 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6970 <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]">
6971 <?php
6972 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6973 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6974 ?>
6975 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6976 <?php
6977 endforeach;
6978 ?>
6979 </select>
6980 </div>
6981 </div> <!-- Crosshair trigger -->
6982 <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">
6983 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6984 <label for="ays-chart-option-crosshair-orientation">
6985 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6986 <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") ); ?>">
6987 <i class="ays_fa ays_fa_info_circle"></i>
6988 </a>
6989 </label>
6990 </div>
6991 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6992 <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]">
6993 <?php
6994 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6995 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6996 ?>
6997 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6998 <?php
6999 endforeach;
7000 ?>
7001 </select>
7002 </div>
7003 </div> <!-- Crosshair orientation -->
7004 <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">
7005 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7006 <label for="ays-chart-option-crosshair-opacity" class="form-label">
7007 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
7008 <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") ); ?>">
7009 <i class="ays_fa ays_fa_info_circle"></i>
7010 </a>
7011 </label>
7012 </div>
7013 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7014 <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">
7015 </div>
7016 </div> <!-- Crosshair opacity -->
7017 <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">
7018 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7019 <label for="ays-chart-option-dash-style" class="form-label">
7020 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
7021 <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") ); ?>">
7022 <i class="ays_fa ays_fa_info_circle"></i>
7023 </a>
7024 </label>
7025 </div>
7026 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7027 <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) ?>">
7028 </div>
7029 </div> <!-- Line dash pattern -->
7030 <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">
7031 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7032 <label for="ays-chart-option-donut-hole-size">
7033 <?php echo esc_html(__( "Hole size", 'chart-builder' )); ?>
7034 </label>
7035 </div>
7036 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right <?php echo esc_attr($html_class_prefix) ?>option-input">
7037 <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) ?>">
7038 </div>
7039 </div> <!-- Donut hole size -->
7040 <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">
7041 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
7042 <div class="ays-pro-features-v2-video-button"></div>
7043 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
7044 <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>
7045 <div class="ays-pro-features-v2-upgrade-text">
7046 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
7047 </div>
7048 </a>
7049 </div>
7050 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix )?>option-title">
7051 <label for="ays-chart-option-curve-type">
7052 <?php echo esc_html(__( "Line curve type", "chart-builder" )); ?>
7053 </label>
7054 </div>
7055 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7056 <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]">
7057 <option><?php echo esc_html(__( "Straight", "chart-builder" )); ?></option>
7058 </select>
7059 </div>
7060 </div> <!-- Line curve type -->
7061 <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">
7062 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7063 <label for="ays-chart-option-allow-collapse">
7064 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
7065 <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") ); ?>">
7066 <i class="ays_fa ays_fa_info_circle"></i>
7067 </a>
7068 </label>
7069 </div>
7070 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7071 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7072 <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); ?> >
7073 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7074 </label>
7075 </div>
7076 </div> <!-- Allow collapse -->
7077 <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">
7078 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7079 <label for="ays-chart-option-org-node-description-font-color">
7080 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
7081 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
7082 <i class="ays_fa ays_fa_info_circle"></i>
7083 </a>
7084 </label>
7085 </div>
7086 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7087 <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) ?>">
7088 </div>
7089 </div> <!-- Org Node Description color -->
7090 <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">
7091 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7092 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
7093 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
7094 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
7095 <i class="ays_fa ays_fa_info_circle"></i>
7096 </a>
7097 </label>
7098 </div>
7099 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7100 <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) ?>">
7101 </div>
7102 </div> <!-- Org Node Description font size -->
7103 <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">
7104 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7105 <label for="ays-chart-option-org-classname" class="form-label">
7106 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
7107 <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") ); ?>">
7108 <i class="ays_fa ays_fa_info_circle"></i>
7109 </a>
7110 </label>
7111 </div>
7112 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7113 <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) ?>">
7114 </div>
7115 </div> <!-- Org custom class -->
7116 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
7117 <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">
7118 <br>
7119 <blockquote>
7120 <?php echo sprintf(
7121 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7122 esc_html(__( '%1$sNote:%2$s Custom CSS class must be set for the options below to take effect.', 'chart-builder' )), '<strong>', '</strong>'); ?>
7123 </blockquote>
7124 <br>
7125 </div>
7126 <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">
7127 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7128 <label for="ays-chart-option-org-node-background-color">
7129 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7130 <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") ); ?>">
7131 <i class="ays_fa ays_fa_info_circle"></i>
7132 </a>
7133 </label>
7134 </div>
7135 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7136 <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) ?>">
7137 </div>
7138 </div> <!-- Org Node Background color -->
7139 <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">
7140 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7141 <label for="ays-chart-option-org-node-padding" class="form-label">
7142 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
7143 <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") ); ?>">
7144 <i class="ays_fa ays_fa_info_circle"></i>
7145 </a>
7146 </label>
7147 </div>
7148 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7149 <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) ?>">
7150 </div>
7151 </div> <!-- Org Node Padding -->
7152 <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">
7153 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7154 <label for="ays-chart-option-org-node-border-radius" class="form-label">
7155 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
7156 <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") ); ?>">
7157 <i class="ays_fa ays_fa_info_circle"></i>
7158 </a>
7159 </label>
7160 </div>
7161 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7162 <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) ?>">
7163 </div>
7164 </div> <!-- Org Node Border radius -->
7165 <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">
7166 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7167 <label for="ays-chart-option-org-node-border-width" class="form-label">
7168 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
7169 <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") ); ?>">
7170 <i class="ays_fa ays_fa_info_circle"></i>
7171 </a>
7172 </label>
7173 </div>
7174 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7175 <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) ?>">
7176 </div>
7177 </div> <!-- Org Node Border width -->
7178 <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">
7179 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7180 <label for="ays-chart-option-org-node-border-color">
7181 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
7182 <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") ); ?>">
7183 <i class="ays_fa ays_fa_info_circle"></i>
7184 </a>
7185 </label>
7186 </div>
7187 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7188 <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) ?>">
7189 </div>
7190 </div> <!-- Org Node Background color -->
7191 <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">
7192 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7193 <label for="ays-chart-option-org-node-text-color">
7194 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7195 <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") ); ?>">
7196 <i class="ays_fa ays_fa_info_circle"></i>
7197 </a>
7198 </label>
7199 </div>
7200 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7201 <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) ?>">
7202 </div>
7203 </div> <!-- Org Node Text color -->
7204 <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">
7205 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7206 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
7207 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
7208 <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") ); ?>">
7209 <i class="ays_fa ays_fa_info_circle"></i>
7210 </a>
7211 </label>
7212 </div>
7213 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7214 <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) ?>">
7215 </div>
7216 </div> <!-- Org Node Text font size -->
7217 </div> <!-- Org custom class options -->
7218 <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">
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-org-selected-classname" class="form-label">
7221 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
7222 <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") ); ?>">
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-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) ?>">
7229 </div>
7230 </div> <!-- Org custom selected class -->
7231 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
7232 <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">
7233 <br>
7234 <blockquote>
7235 <?php echo sprintf(
7236 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7237 esc_html(__( '%1$sNote:%2$s Selected node custom CSS class must be set for the options below to take effect.', 'chart-builder' )),
7238 '<strong>',
7239 '</strong>'
7240 ); ?>
7241 </blockquote>
7242 <br>
7243 </div>
7244 <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">
7245 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7246 <label for="ays-chart-option-org-selected-node-background-color">
7247 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7248 <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") ); ?>">
7249 <i class="ays_fa ays_fa_info_circle"></i>
7250 </a>
7251 </label>
7252 </div>
7253 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7254 <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) ?>">
7255 </div>
7256 </div> <!-- Org selected Node Background color -->
7257 <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">
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-org-selected-node-text-color">
7260 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7261 <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") ); ?>">
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) ?>input-align-right">
7267 <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) ?>">
7268 </div>
7269 </div> <!-- Org selected Node text color -->
7270 </div> <!-- Org custom selected class options -->
7271 </div>
7272 </div>
7273 <?php
7274 $content = ob_get_clean();
7275
7276 $sources['advanced_settings'] = array(
7277 'content' => $content,
7278 'title' => $tab_title
7279 );
7280
7281 return $sources;
7282 }
7283
7284 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
7285 $html_class_prefix = $args['html_class_prefix'];
7286 $html_name_prefix = $args['html_name_prefix'];
7287 $settings = $args['settings'];
7288 $tab_title = $args['tab_name'];
7289
7290 $outer_radius = $settings['outer_radius'];
7291 $slice_spacing = $settings['slice_spacing'];
7292 $circumference = $settings['circumference'];
7293 $start_angle = $settings['start_angle'];
7294 // $index_axis = $settings['index_axis'];
7295
7296 ob_start();
7297 ?>
7298 <div class="ays-accordion-data-main-wrap">
7299 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
7300 <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">
7301 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7302 <label for="ays-chart-option-outer-radius" class="form-label">
7303 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
7304 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
7305 <i class="ays_fa ays_fa_info_circle"></i>
7306 </a>
7307 </label>
7308 </div>
7309 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7310 <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) ?>">
7311 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7312 </div>
7313 </div> <!-- Outer Radius -->
7314 <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">
7315 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7316 <label for="ays-chart-option-slice-spacing" class="form-label">
7317 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
7318 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
7319 <i class="ays_fa ays_fa_info_circle"></i>
7320 </a>
7321 </label>
7322 </div>
7323 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7324 <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) ?>">
7325 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7326 </div>
7327 </div> <!-- Slice Spacing -->
7328 <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">
7329 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7330 <label for="ays-chart-option-circumference" class="form-label">
7331 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
7332 <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") ); ?>">
7333 <i class="ays_fa ays_fa_info_circle"></i>
7334 </a>
7335 </label>
7336 </div>
7337 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7338 <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) ?>">
7339 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7340 </div>
7341 </div> <!-- Arc Coverage -->
7342 <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">
7343 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7344 <label for="ays-chart-option-start-angle" class="form-label">
7345 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
7346 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
7347 <i class="ays_fa ays_fa_info_circle"></i>
7348 </a>
7349 </label>
7350 </div>
7351 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7352 <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) ?>">
7353 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7354 </div>
7355 </div> <!-- Start Angle -->
7356 <!-- <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">
7357 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
7358 <label for="ays-chart-option-index-axis">
7359 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
7360 <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") ); ?>">
7361 <i class="ays_fa ays_fa_info_circle"></i>
7362 </a>
7363 </label>
7364 </div>
7365 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
7366 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7367 <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); ?> >
7368 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7369 </label>
7370 </div>
7371 </div> Reverse Categories -->
7372 </div>
7373 </div>
7374 <?php
7375 $content = ob_get_clean();
7376
7377 $sources['advanced_settings'] = array(
7378 'content' => $content,
7379 'title' => $tab_title
7380 );
7381
7382 return $sources;
7383 }
7384
7385 public function settings_contents_slices_settings( $sources, $args ){
7386 $html_class_prefix = $args['html_class_prefix'];
7387 $html_name_prefix = $args['html_name_prefix'];
7388 $settings = $args['settings'];
7389 $source = $args['source'];
7390 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7391 $source_chart_type = $args['source_chart_type'];
7392 $settings = $args['settings'];
7393 $title_row = array_shift($source);
7394
7395 if (isset($source) && !empty($source)) {
7396 if ( !isset( $source[0] ) ) {
7397 if (count($source[1]) > 2) {
7398 $titles = array();
7399 for ($i = 0; $i < count($source[1]); $i++) {
7400 array_push($titles, __("Title", 'chart-builder').$i);
7401 }
7402 $source[0] = $titles;
7403 } else {
7404 $source[0] = array(
7405 __("Country", 'chart-builder'),
7406 __("Population", 'chart-builder'),
7407 );
7408 }
7409
7410 ksort($source);
7411 }
7412 }
7413
7414 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7415 foreach ($source as $key => $row) {
7416 $source[$key] = array_slice($row, 0, 2);
7417 }
7418 }
7419
7420 ob_start();
7421 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7422 $slice_color = $settings['slice_color'];
7423 $slice_colors_default = $settings['slice_colors_default'];
7424 $slice_offset = $settings['slice_offset'];
7425 $slice_text_color = $settings['slice_text_color'];
7426
7427 ?>
7428 <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">
7429 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7430 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
7431 <?php
7432 foreach ( $source as $key => $val ):
7433 ?>
7434 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
7435 <legend class="ays-slices-accordion-options-header">
7436 <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">
7437 <g>
7438 <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" />
7439 </g>
7440 </svg>
7441 <span><?php echo esc_html($val[0]); ?></span>
7442 </legend>
7443 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
7444 <div class="ays-slices-accordion-data-main-wrap">
7445 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7446 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7447 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7448 <label for="ays-chart-option-slice-color">
7449 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7450 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
7451 <i class="ays_fa ays_fa_info_circle"></i>
7452 </a>
7453 </label>
7454 </div>
7455 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7456 <input type="color"
7457 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
7458 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7459 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
7460 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
7461 data-slice-id="<?php echo esc_attr($key); ?>">
7462 </div>
7463 </div> <!-- Slice color -->
7464 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7465 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7466 <label for="ays-chart-option-slice-offset" class="form-label">
7467 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
7468 <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") ); ?>">
7469 <i class="ays_fa ays_fa_info_circle"></i>
7470 </a>
7471 </label>
7472 </div>
7473 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7474 <input type="number"
7475 id="ays-chart-option-slice-offset-<?php echo esc_attr($key); ?>"
7476 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7477 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo esc_attr($key); ?>]"
7478 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
7479 data-slice-id="<?php echo esc_attr($key); ?>"
7480 step=".01" min="0.0" max="1.0">
7481 </div>
7482 </div> <!-- Slice offset -->
7483 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-slice-text-color">
7486 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7487 <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") ); ?>">
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) ?>input-align-right">
7493 <input type="color"
7494 id="ays-chart-option-slice-text-color-<?php echo esc_attr($key); ?>"
7495 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7496 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo esc_attr($key); ?>]"
7497 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
7498 data-slice-id="<?php echo esc_attr($key); ?>">
7499 </div>
7500 </div> <!-- Slice color -->
7501 </div>
7502 </div>
7503 </div>
7504 </fieldset>
7505 <?php
7506 endforeach;
7507 ?>
7508 </div>
7509 </div>
7510 <br>
7511 <blockquote>
7512 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
7513 </blockquote>
7514 </div>
7515 <?php
7516
7517 } else {
7518 ?>
7519 <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>
7520 <?php
7521 }
7522
7523 $content = ob_get_clean();
7524
7525 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
7526
7527 $sources['slices_settings'] = array(
7528 'content' => $content,
7529 'title' => $title
7530 );
7531
7532 return $sources;
7533 }
7534
7535 public function settings_contents_series_settings( $sources, $args ){
7536 $html_class_prefix = $args['html_class_prefix'];
7537 $html_name_prefix = $args['html_name_prefix'];
7538 $settings = $args['settings'];
7539 $source = $args['source'];
7540 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7541 $source_chart_type = $args['source_chart_type'];
7542
7543 $line_width = $settings['line_width'];
7544 $point_size = $settings['point_size'];
7545 $point_shape_options = $settings['point_shape_options'];
7546 $point_shape = $settings['point_shape'];
7547
7548 if (isset($source) && !empty($source)) {
7549 if ( !isset( $source[0] ) ) {
7550 if (count($source[1]) > 2) {
7551 $titles = array();
7552 for ($i = 0; $i < count($source[1]); $i++) {
7553 array_push($titles, __("Title", "chart-builder").$i);
7554 }
7555 $source[0] = $titles;
7556 } else {
7557 $source[0] = array(
7558 __("Country", "chart-builder"),
7559 __("Population", "chart-builder"),
7560 );
7561 }
7562
7563 ksort($source);
7564 }
7565 }
7566
7567 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7568 foreach ($source as $key => $row) {
7569 $source[$key] = array_slice($row, 0, 2);
7570 }
7571 }
7572
7573 ob_start();
7574 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
7575 $series_row = array_shift($source);
7576 $title = array_shift($series_row);
7577 $series_color = $settings['series_color'];
7578 $series_colors_default = $settings['series_colors_default'];
7579 $series_format = $settings['series_format'];
7580 $series_visible_in_legend = $settings['series_visible_in_legend'];
7581 $series_line_width = $settings['series_line_width'];
7582 $series_point_size = $settings['series_point_size'];
7583 $series_point_shape = $settings['series_point_shape'];
7584
7585 ?>
7586 <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">
7587 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7588 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
7589 <?php
7590 foreach ( $series_row as $key => $val ):
7591 ?>
7592 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
7593 <legend class="ays-series-accordion-options-header">
7594 <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">
7595 <g>
7596 <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" />
7597 </g>
7598 </svg>
7599 <span><?php echo esc_attr($val); ?></span>
7600 </legend>
7601 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
7602 <div class="ays-series-accordion-data-main-wrap">
7603 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7604 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7605 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7606 <label for="ays-chart-option-series-color">
7607 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7608 </label>
7609 </div>
7610 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7611 <input type="color"
7612 id="ays-chart-option-series-color-<?php echo esc_attr($key); ?>"
7613 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7614 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo esc_attr($key); ?>]"
7615 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : esc_attr($series_colors_default[$key]); ?>"
7616 data-series-id="<?php echo esc_attr($key); ?>">
7617 </div>
7618 </div> <!-- series color -->
7619 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7620 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7621 <label for="ays-chart-option-series-visible-in-legend">
7622 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
7623 <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") ); ?>">
7624 <i class="ays_fa ays_fa_info_circle"></i>
7625 </a>
7626 </label>
7627 </div>
7628 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7629 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7630 <input type="checkbox"
7631 id="ays-chart-option-series-visible-in-legend-<?php echo esc_attr($key); ?>"
7632 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
7633 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo esc_attr($key); ?>]"
7634 value="on"
7635 data-series-id="<?php echo esc_attr($key); ?>"
7636 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
7637 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7638 </label>
7639 </div>
7640 </div> <!-- Series visible in legend -->
7641 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7642 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7643 <label for="ays-chart-option-series-color">
7644 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
7645 <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") ); ?>">
7646 <i class="ays_fa ays_fa_info_circle"></i>
7647 </a>
7648 </label>
7649 </div>
7650 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7651 <input type="text"
7652 id="ays-chart-option-series-format-<?php echo $key; ?>"
7653 class="ays-chart-option-series-format ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7654 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_format][<?php echo $key; ?>]"
7655 value="<?php echo isset($series_format[$key]) && '' !== $series_format[$key] ? esc_attr($series_format[$key]) : ''; ?>"
7656 data-series-id="<?php echo $key; ?>">
7657 </div>
7658 </div> <!-- Format -->
7659 <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">
7660 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7661 <label for="ays-chart-option-series-line-width">
7662 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
7663 <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") ); ?>">
7664 <i class="ays_fa ays_fa_info_circle"></i>
7665 </a>
7666 </label>
7667 </div>
7668 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7669 <input type="number"
7670 id="ays-chart-option-series-line-width-<?php echo esc_attr($key); ?>"
7671 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7672 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo esc_attr($key); ?>]"
7673 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : esc_attr($line_width); ?>"
7674 data-series-id="<?php echo esc_attr($key); ?>">
7675 </div>
7676 </div> <!-- Line width -->
7677 <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">
7678 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7679 <label for="ays-chart-option-series-point-size">
7680 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7681 <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") ); ?>">
7682 <i class="ays_fa ays_fa_info_circle"></i>
7683 </a>
7684 </label>
7685 </div>
7686 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7687 <input type="number"
7688 id="ays-chart-option-series-point-size-<?php echo esc_attr($key); ?>"
7689 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7690 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo esc_attr($key); ?>]"
7691 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : esc_attr($point_size); ?>"
7692 data-series-id="<?php echo esc_attr($key); ?>">
7693 </div>
7694 </div> <!-- Point size -->
7695 <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">
7696 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7697 <label for="ays-chart-option-series-point-shape">
7698 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7699 <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") ); ?>">
7700 <i class="ays_fa ays_fa_info_circle"></i>
7701 </a>
7702 </label>
7703 </div>
7704 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7705 <select
7706 id="ays-chart-option-series-point-shape-<?php echo esc_attr($key); ?>"
7707 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
7708 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo esc_attr($key); ?>]"
7709 data-series-id="<?php echo esc_attr($key); ?>">
7710 >
7711 <?php
7712 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
7713 foreach ( $point_shape_options as $option_slug => $option ):
7714 $selected = ( $value === $option_slug ) ? 'selected' : '';
7715 ?>
7716 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7717 <?php
7718 endforeach;
7719 ?>
7720 </select>
7721 </div>
7722 </div> <!-- Point shape -->
7723 </div>
7724 </div>
7725 </div>
7726 </fieldset>
7727 <?php
7728 endforeach;
7729 ?>
7730 </div>
7731 </div>
7732 <br>
7733 <blockquote>
7734 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
7735 <br>
7736 <?php echo sprintf(
7737 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7738 esc_html(__( '%1$sNote:%2$s If you are not able to set the options, disable the row settings feature.', 'chart-builder' )),
7739 '<strong>',
7740 '</strong>'
7741 ); ?>
7742 </blockquote>
7743 </div>
7744 <?php
7745
7746 } else {
7747 ?>
7748 <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>
7749 <?php
7750 }
7751
7752 $content = ob_get_clean();
7753
7754 $title = __( 'Series settings', "chart-builder" );
7755
7756 $sources['series_settings'] = array(
7757 'content' => $content,
7758 'title' => $title
7759 );
7760
7761 return $sources;
7762 }
7763
7764 public function settings_contents_row_settings( $sources, $args ){
7765 $html_class_prefix = $args['html_class_prefix'];
7766 $html_name_prefix = $args['html_name_prefix'];
7767 $settings = $args['settings'];
7768 $source = $args['source'];
7769 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7770 $source_chart_type = $args['source_chart_type'];
7771
7772 if (isset($source) && !empty($source)) {
7773 if ( !isset( $source[0] ) ) {
7774 if (count($source[1]) > 2) {
7775 $titles = array();
7776 for ($i = 0; $i < count($source[1]); $i++) {
7777 array_push($titles, __("Title", 'chart-builder').$i);
7778 }
7779 $source[0] = $titles;
7780 } else {
7781 $source[0] = array(
7782 __("Country", 'chart-builder'),
7783 __("Population", 'chart-builder'),
7784 );
7785 }
7786
7787 ksort($source);
7788 }
7789 }
7790
7791 array_shift($source);
7792 $rows = array_column($source, 0);
7793
7794 $enable_row_settings = $settings['enable_row_settings'];
7795 $series_color = $settings['series_color'][0] ?? '#3366cc';
7796 $rows_color = $settings['rows_color'];
7797 $rows_opacity = $settings['rows_opacity'];
7798
7799 ob_start();
7800 ?>
7801 <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">
7802 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7803 <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">
7804 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7805 <label for="ays-chart-option-enable-row-settings">
7806 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7807 <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") ); ?>">
7808 <i class="ays_fa ays_fa_info_circle"></i>
7809 </a>
7810 </label>
7811 </div>
7812 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7813 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7814 <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); ?> >
7815 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7816 </label>
7817 </div>
7818 </div> <!-- Enable row settings -->
7819 <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'; ?>">
7820 <br>
7821 <?php
7822 foreach ( $rows as $key => $val ):
7823 ?>
7824 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7825 <legend class="ays-rows-accordion-options-header">
7826 <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">
7827 <g>
7828 <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" />
7829 </g>
7830 </svg>
7831 <span><?php echo esc_html($val); ?></span>
7832 </legend>
7833 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7834 <div class="ays-rows-accordion-data-main-wrap">
7835 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7836 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7837 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7838 <label for="ays-chart-option-rows-color">
7839 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7840 </label>
7841 </div>
7842 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7843 <input type="color"
7844 id="ays-chart-option-rows-color-<?php echo esc_attr($key); ?>"
7845 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7846 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo esc_attr($key); ?>]"
7847 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : esc_attr($series_color); ?>"
7848 data-rows-id="<?php echo esc_attr($key); ?>">
7849 </div>
7850 </div> <!-- color -->
7851 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7852 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7853 <label for="ays-chart-option-rows-color">
7854 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7855 </label>
7856 </div>
7857 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7858 <input type="number"
7859 id="ays-chart-option-rows-opacity-<?php echo esc_attr($key); ?>"
7860 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7861 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo esc_attr($key); ?>]"
7862 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7863 data-rows-id="<?php echo esc_attr($key); ?>"
7864 step=".1" min="0" max="1">
7865 </div>
7866 </div> <!-- opacity -->
7867 </div>
7868 </div>
7869 </div>
7870 </fieldset>
7871 <?php
7872 endforeach;
7873 ?>
7874 <br>
7875 <blockquote>
7876 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
7877 <br>
7878 <?php echo sprintf(
7879 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7880 esc_html(__( '%1$sNote:%2$s The applied styles will work only if the chart has one column.', 'chart-builder' )),
7881 '<strong>',
7882 '</strong>'
7883 ); ?>
7884 </blockquote>
7885 </div>
7886 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7887 <br>
7888 <blockquote>
7889 <?php echo sprintf(
7890 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7891 esc_html(__( '%1$sNote:%2$s If this option is disabled, the general options will be set from the series settings.', 'chart-builder' )),
7892 '<strong>',
7893 '</strong>'
7894 ); ?>
7895 </blockquote>
7896 </div>
7897 </div>
7898 </div>
7899 <?php
7900 $content = ob_get_clean();
7901
7902 $title = __( 'Row settings', "chart-builder" );
7903
7904 $sources['row_settings'] = array(
7905 'content' => $content,
7906 'title' => $title
7907 );
7908
7909 return $sources;
7910 }
7911 }
7912