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

7,837 lines 562.7 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 'actions' => array(
230 'filter_get_props' => 'fetch_post_type_props',
231 'filter_get_data' => 'fetch_post_type_data',
232 'quiz_maker_get_data' => 'fetch_quiz_maker_data',
233 'quiz_maker_save_data' => 'save_quiz_maker_data',
234 'author_user_search' => 'author_user_search'
235 ),
236 ),
237 'db_query' => array(
238 'tables' => $table_col_mapping,
239 ),
240 ) );
241
242 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 );
243 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 );
244 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 );
245 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, true );
246
247 if ( false !== strpos( $hook_suffix, 'settings' ) ) {
248 wp_enqueue_script( $this->plugin_name . '-settings', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-settings.js', array( 'jquery' ), $this->version, true );
249
250 wp_localize_script( $this->plugin_name . '-settings', 'aysChartBuilderAdminSettings', array(
251 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
252 'selectUserRoles' => __( 'Select user roles', 'chart-builder' ),
253 'delete' => __( 'Delete', 'chart-builder' ),
254 'selectQuestionDefaultType' => __( 'Select question default type', 'chart-builder' ),
255 'yes' => __( 'Yes', 'chart-builder' ),
256 'cancel' => __( 'Cancel', 'chart-builder' ),
257 'somethingWentWrong' => __( "Maybe something went wrong.", 'chart-builder' ),
258 'failed' => __( 'Failed', 'chart-builder' ),
259 'selectPage' => __( 'Select page', 'chart-builder' ),
260 'selectPostType' => __( 'Select post type', 'chart-builder' ),
261 'copied' => __( 'Copied!', 'chart-builder'),
262 'clickForCopy' => __( 'Click to copy', 'chart-builder'),
263 'selectForm' => __( 'Select form', 'chart-builder'),
264 ) );
265 }
266 }
267
268 /**
269 * De-register JavaScript files for the admin area.
270 *
271 * @since 1.0.0
272 */
273 public function disable_scripts($hook_suffix) {
274 if (false !== strpos($hook_suffix, $this->plugin_name)) {
275 if (is_plugin_active('ai-engine/ai-engine.php')) {
276 wp_deregister_script('mwai');
277 wp_deregister_script('mwai-vendor');
278 wp_dequeue_script('mwai');
279 wp_dequeue_script('mwai-vendor');
280 }
281 }
282 }
283
284 /**
285 * Register the administration menu for this plugin into the WordPress Dashboard menu.
286 *
287 * @since 1.0.0
288 */
289 public function add_plugin_admin_menu(){
290
291 /*
292 * Add a settings page for this plugin to the Settings menu.
293 *
294 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
295 *
296 * Administration Menus: http://codex.wordpress.org/Administration_Menus
297 *
298 */
299 global $wpdb;
300 $menu_item = __( 'Chart Builder', "chart-builder" );
301 $this->capability = 'manage_options';
302
303 add_menu_page(
304 __( 'Chart Builder', "chart-builder" ),
305 $menu_item,
306 $this->capability,
307 $this->plugin_name,
308 array($this, 'display_plugin_charts_page'),
309 CHART_BUILDER_ADMIN_URL . '/images/icons/ays_chart_logo_icon_bw.svg',
310 '6.22'
311 );
312
313 }
314
315 public function add_plugin_charts_submenu(){
316 $hook_page_view = add_submenu_page(
317 $this->plugin_name,
318 __('All Charts', 'chart-builder'),
319 __('All Charts', 'chart-builder'),
320 'manage_options',
321 $this->plugin_name,
322 array($this, 'display_plugin_charts_page')
323 );
324
325 add_action( "load-$hook_page_view", array( $this, 'screen_option_charts' ) );
326 }
327
328 public function add_plugin_add_new_submenu(){
329 $hook_charts = add_submenu_page(
330 $this->plugin_name,
331 __('Add New', 'chart-builder'),
332 __('Add New', 'chart-builder'),
333 'manage_options',
334 $this->plugin_name."&action=add",
335 array($this, 'display_plugin_addnew_page')
336 );
337 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
338 }
339
340 public function add_plugin_dashboard_submenu(){
341 $hook_charts = add_submenu_page(
342 $this->plugin_name,
343 __('How to use', 'chart-builder'),
344 __('How to use', 'chart-builder'),
345 'manage_options',
346 $this->plugin_name . '-dashboard',
347 array($this, 'display_plugin_setup_page')
348 );
349 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
350 }
351
352 public function add_plugin_general_settings_submenu(){
353 $hook_settings = add_submenu_page( $this->plugin_name,
354 __('General Settings', 'chart-builder'),
355 __('General Settings', 'chart-builder'),
356 'manage_options',
357 $this->plugin_name . '-settings',
358 array($this, 'display_plugin_settings_page')
359 );
360 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
361 }
362
363 public function add_plugin_featured_plugins_submenu(){
364 $hook_our_products = add_submenu_page( $this->plugin_name,
365 __('Our products', 'chart-builder'),
366 __('Our products', 'chart-builder'),
367 'manage_options',
368 $this->plugin_name . '-featured-plugins',
369 array($this, 'display_plugin_featured_plugins_page')
370 );
371
372 add_action("load-$hook_our_products", array( $this, 'add_tabs' ));
373 }
374
375 public function add_plugin_chart_features_submenu(){
376 $hook_pro_features = add_submenu_page(
377 $this->plugin_name,
378 __('PRO Features', 'chart-builder'),
379 __('PRO Features', 'chart-builder'),
380 'manage_options',
381 $this->plugin_name . '-chart-features',
382 array($this, 'display_plugin_chart_features_page')
383 );
384
385 add_action("load-$hook_pro_features", array( $this, 'add_tabs' ));
386 }
387
388 public function screen_option_charts(){
389 $option = 'per_page';
390 $args = array(
391 'label' => __('Charts', "chart-builder"),
392 'default' => 5,
393 'option' => 'cb_charts_per_page'
394 );
395
396 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
397 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
398 add_screen_option( $option, $args );
399 }
400
401 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
402 }
403
404 public function screen_option_settings(){
405 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
406 }
407
408 public function add_tabs() {
409 $screen = get_current_screen();
410
411 if ( ! $screen) {
412 return;
413 }
414 }
415
416 public function display_plugin_charts_page(){
417 global $ays_chart_db_actions;
418
419 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
420 $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
421 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
422 $id = (isset($_GET['id'])) ? absint( wp_unslash( $_GET['id'] ) ) : 0;
423 if (isset($_POST['bulk_delete_confirm'])) {
424 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
425 $ids = wp_unslash( $_POST['bulk-delete'] );
426 $ids = array_map( 'absint', (array) $ids );
427 foreach ($ids as $id) {
428 if ($id > 0) {
429 $this->db_obj->delete_item( $id );
430 }
431 }
432 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
433 $url = esc_url_raw( add_query_arg( array(
434 "status" => 'all-deleted'
435 ), $url ) );
436 wp_redirect( $url );
437 exit;
438 }
439 }
440
441 switch ($action) {
442 case 'trash':
443 if( $id > 0 ){
444 $this->db_obj->trash_item( $id );
445 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
446 $url = esc_url_raw( add_query_arg( array(
447 "status" => 'trashed'
448 ), $url ) );
449 wp_redirect( $url );
450 exit;
451 }
452 break;
453 case 'restore':
454 if( $id > 0 ){
455 $this->db_obj->restore_item( $id );
456 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
457 $url = esc_url_raw( add_query_arg( array(
458 "status" => 'restored'
459 ), $url ) );
460 wp_redirect( $url );
461 exit;
462 }
463 break;
464 case 'delete':
465 if( $id > 0 ){
466 $this->db_obj->delete_item( $id );
467 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
468 $url = esc_url_raw( add_query_arg( array(
469 "status" => 'deleted'
470 ), $url ) );
471 wp_redirect( $url );
472 exit;
473 }
474 break;
475 case 'publish':
476 if( $id > 0 ){
477 $this->db_obj->publish_item( $id );
478 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
479 $url = esc_url_raw( add_query_arg( array(
480 "status" => 'published'
481 ), $url ) );
482 wp_redirect( $url );
483 exit;
484 }
485 break;
486 case 'unpublish':
487 if( $id > 0 ){
488 $this->db_obj->restore_item( $id );
489 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
490 $url = esc_url_raw( add_query_arg( array(
491 "status" => 'unpublished'
492 ), $url ) );
493 wp_redirect( $url );
494 exit;
495 }
496 break;
497 case 'duplicate':
498 if( $id > 0 ){
499 $this->db_obj->duplicate_item( $id );
500 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
501 $url = esc_url_raw( add_query_arg( array(
502 "status" => 'duplicated'
503 ), $url ) );
504 wp_redirect( $url );
505 exit;
506 }
507 break;
508 case 'add':
509 include_once('partials/charts/actions/chart-builder-charts-actions.php');
510 break;
511 case 'edit':
512 include_once('partials/charts/actions/chart-builder-charts-actions.php');
513 break;
514 default:
515 include_once('partials/charts/chart-builder-charts-display.php');
516 }
517 }
518 public static function chart_builder_svg_sanitize_allowed_properties(){
519
520 $allowed_properties = array(
521 'div' => array(
522 'id' => true,
523 'class' => true,
524 'style' => true,
525 ),
526 'svg' => array(
527 'class' => true,
528 'version' => true,
529 'overflow' => true,
530 'preserveAspectRatio' => true,
531 'preserveaspectratio' => true,
532 'fill' => true,
533 'viewBox' => true,
534 'viewbox' => true,
535 'height' => true,
536 'width' => true,
537 'xmlns' => true,
538 'xmlns:xlink' => true,
539 'id' => true,
540 'title' => true,
541 ),
542 'g' => array(
543 'id' => true,
544 'class' => true,
545 'stroke-width' => true,
546 'stroke-linecap' => true,
547 'stroke-linejoin' => true,
548 ),
549 'path' => array(
550 'id' => true,
551 'class' => true,
552 'd' => true,
553 'fill' => true,
554 'vector-effect' => true,
555 'xmlns:default' => true,
556 ),
557 'span' => array(
558 'class' => true,
559 ),
560 'img' => array(
561 'src' => true,
562 'alt' => true,
563 ),
564 );
565
566 return $allowed_properties;
567 }
568
569 public static function get_allowed_tags_for_loader() {
570 return array(
571 'span' => array('class' => array()),
572 'img' => array('src' => array(), 'alt' => array()),
573 );
574 }
575
576 public function display_plugin_setup_page(){
577 include_once('partials/chart-builder-admin-display.php');
578 }
579
580 public function display_plugin_addnew_page(){
581
582 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
583 // $url = esc_url_raw( add_query_arg( array(
584 // "action" => 'add'
585 // ), $url ) );
586 // wp_redirect( $url );
587 }
588
589 public function display_plugin_settings_page(){
590 include_once('partials/settings/chart-builder-settings.php');
591 }
592
593 public function display_plugin_featured_plugins_page(){
594 include_once('partials/features/chart-builder-plugin-featured-display.php');
595 }
596
597 public function display_plugin_chart_features_page(){
598 include_once('partials/features/chart-builder-features-display.php');
599 }
600
601 /**
602 * Add settings action link to the plugins page.
603 *
604 * @since 1.0.0
605 */
606 public function add_action_links( $links ){
607
608 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
609
610 /*
611 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
612 */
613 $settings_link = array(
614 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
615 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
616 // '<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>',
617 '<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>
618 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
619 );
620 return array_merge( $settings_link, $links );
621
622 }
623
624
625 public static function set_screen($status, $option, $value){
626 return $value;
627 }
628
629 public function ays_admin_ajax(){
630 global $wpdb;
631
632 $response = array(
633 "status" => false
634 );
635 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
636 $function = isset( $_REQUEST['function'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['function'] ) ) : null;
637
638 if($function !== null){
639 $response = array();
640 if( is_callable( array( $this, $function ) ) ){
641 $response = $this->$function();
642
643 ob_end_clean();
644 $ob_get_clean = ob_get_clean();
645 echo json_encode( $response );
646 wp_die();
647 }
648
649 }
650
651 ob_end_clean();
652 $ob_get_clean = ob_get_clean();
653 echo json_encode( $response );
654 wp_die();
655 }
656
657 public function deactivate_plugin_option(){
658 // Run a security check.
659 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
660 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
661 } else {
662 wp_die();
663 }
664
665 // Check for permissions.
666 if ( ! current_user_can( 'manage_options' ) ) {
667 ob_end_clean();
668 $ob_get_clean = ob_get_clean();
669 echo json_encode(array(
670 'option' => ''
671 ));
672 wp_die();
673 }
674
675 if( is_user_logged_in() ) {
676 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['upgrade_plugin'] ) ) : '';
677 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
678
679 if ( $upgrade_option === '' ) {
680 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
681 } else {
682 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
683 }
684
685 $response = array(
686 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
687 );
688
689 wp_send_json_success( $response );
690 } else {
691 ob_end_clean();
692 $ob_get_clean = ob_get_clean();
693 echo json_encode(array(
694 'option' => ''
695 ));
696 wp_die();
697 }
698 }
699
700 public function chart_builder_admin_footer($a){
701 if(isset($_REQUEST['page'])){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
702 if(false !== strpos( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ), $this->plugin_name)){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
703 ?>
704 <div class="ays-chart-footer-support-box">
705 <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>
706 <span class="ays-chart-footer-slash-row">/</span>
707 <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>
708 <span class="ays-chart-footer-slash-row">/</span>
709 <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>
710 </div>
711 <p style="font-size:13px;text-align:center;font-style:italic;">
712 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
713 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
714 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
715 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
716 </p>
717 <?php
718 }
719 }
720 }
721
722 // Chart Builder Elementor widget init
723 public function chart_builder_el_widgets_registered() {
724 // We check if the Elementor plugin has been installed / activated.
725 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
726 // get our own widgets up and running:
727 // copied from widgets-manager.php
728 if ( class_exists( 'Elementor\Plugin' ) ) {
729 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
730 $elementor = Elementor\Plugin::instance();
731 if ( isset( $elementor->widgets_manager ) ) {
732 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
733 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
734 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
735 $template_file = locate_template( $widget_file );
736 if ( !$template_file || !is_readable( $template_file ) ) {
737 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
738 }
739 if ( $template_file && is_readable( $template_file ) ) {
740 require_once $template_file;
741 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
742 }
743 }
744 }
745 }
746 }
747 }
748 }
749
750 public function fetch_post_type_props(){
751 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
752 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'cbuilder-fetch-post-type-props' ) : '';
753 if ( $nonce ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
754 $results = isset($_POST['post_type']) ? CBFunctions()->get_post_type_properties( sanitize_text_field( wp_unslash($_POST['post_type']) ) ) : '';
755
756 return array(
757 'success' => true,
758 'fields' => $results,
759 );
760 }
761
762 return array(
763 'success' => false,
764 );
765 }
766
767 public static function get_max_id( $table ) {
768 global $wpdb;
769 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
770
771 $sql = "SELECT MAX(id) FROM {$db_table}";
772
773 $result = intval( $wpdb->get_var( $sql ) );
774
775 return $result;
776 }
777
778 public static function ays_restriction_string($type, $x, $length){
779 $output = "";
780 switch($type){
781 case "char":
782 if(strlen($x)<=$length){
783 $output = $x;
784 } else {
785 $output = substr($x,0,$length) . '...';
786 }
787 break;
788 case "word":
789 $res = explode(" ", $x);
790 if(count($res)<=$length){
791 $output = implode(" ",$res);
792 } else {
793 $res = array_slice($res,0,$length);
794 $output = implode(" ",$res) . '...';
795 }
796 break;
797 }
798 return $output;
799 }
800
801 public function ays_chart_sale_banner(){
802 // 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' )) {
803 // update_option('ays_chart_sale_btn', 1);
804 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
805 // }
806
807 $ays_chart_sale_date = get_option('ays_chart_sale_date');
808
809 $val = 60*60*24*5;
810
811 $current_date = current_time( 'mysql' );
812 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
813
814 $days_diff = $date_diff / $val;
815
816 if(intval($days_diff) > 0 ){
817 update_option('ays_chart_sale_btn', 0);
818 }
819
820 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
821 if( $ays_chart_builder_flag == 0 ){
822 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
823 if ( isset( $_GET['page'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), CHART_BUILDER_NAME ) !== false ) {
824 if( !(Chart_Builder_Admin::get_max_id('charts') <= 1) ){
825 // $this->ays_chart_sale_message_30_emma($ays_chart_builder_flag);
826 $this->ays_chart_new_silver_bundle_message_2025($ays_chart_builder_flag);
827 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
828 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
829 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
830 // $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
831 // $this->ays_chart_christmas_message_2024($ays_chart_builder_flag);
832 }
833 }
834 }
835 }
836
837 public function ays_chart_dismiss_button(){
838
839 $data = array(
840 'status' => false,
841 );
842
843 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
844 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' ) ) {
845 update_option('ays_chart_sale_btn', 1);
846 update_option('ays_chart_sale_date', current_time( 'mysql' ));
847 $data['status'] = true;
848 }
849 }
850
851 ob_end_clean();
852 $ob_get_clean = ob_get_clean();
853 echo json_encode($data);
854 wp_die();
855
856 }
857
858 // 30% Sale Emma
859 public function ays_chart_sale_message_30_emma($ishmar){
860 if($ishmar == 0 ){
861 $content = array();
862 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
863 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
864
865 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
866 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
867
868 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
869 $content[] = '<div>
870 <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;">
871 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
872 </div>';
873 $content[] = '</div>';
874
875 $content[] = '<div style="font-size: 17px;">';
876 $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
877 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
878
879 $content[] = '</div>';
880
881
882
883 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
884
885 $content[] = '<form action="" method="POST">';
886 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
887 if( current_user_can( 'manage_options' ) ){
888 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
889 ">Dismiss ad</button>';
890 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
891 }
892 $content[] = '</div>';
893 $content[] = '</form>';
894
895 $content[] = '</div>';
896
897 $content[] = '</div>';
898
899 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
900
901 $content[] = '<div id="ays-chart-countdown-main-container">';
902 $content[] = '<div class="ays-chart-countdown-container">';
903
904 $content[] = '<div id="ays-chart-countdown">';
905
906 $content[] = '<div style="font-weight: 500;">';
907 $content[] = __( "Offer ends in:", "chart-builder" );
908 $content[] = '</div>';
909
910 $content[] = '<ul>';
911 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
912 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
913 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
914 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
915 $content[] = '</ul>';
916 $content[] = '</div>';
917
918 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
919 $content[] = '<span>🚀</span>';
920 $content[] = '<span>⌛</span>';
921 $content[] = '<span>🔥</span>';
922 $content[] = '<span>💣</span>';
923 $content[] = '</div>';
924
925 $content[] = '</div>';
926 $content[] = '</div>';
927
928 $content[] = '</div>';
929
930 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
931 $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>';
932 $content[] = '<span >One-time payment</span>';
933 $content[] = '</div>';
934 $content[] = '</div>';
935 $content[] = '</div>';
936
937 $content = implode( '', $content );
938 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
939
940 }
941 }
942
943 // Self 20% sale
944 public static function ays_chart_sale_message20($ishmar){
945 if($ishmar == 0 ){
946 $content = array();
947
948 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
949 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
950 // $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>';
951
952 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
953
954 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
955 $content[] = '<span class="ays-chart-new-chart-pro-title">';
956 // Translators: %s is the URL to the Chart Builder plugin page.
957 $content[] = sprintf(
958 /* translators: %s is the Chart Builder plugin URL. */
959 __(
960 "<span><a href='%s' target='_blank' style='color:#ffffff; text-decoration: underline;'>Chart Builder</a></span>",
961 'chart-builder'
962 ),
963 "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
964 );
965 $content[] = '</span>';
966 $content[] = '<div>';
967 $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
968 $content[] = '</div>';
969 $content[] = '</div>';
970
971 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
972 $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
973 $content[] = esc_html__( "30 Days Money Back Guarantee", 'chart-builder' );
974 $content[] = '</span>';
975
976 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
977 $content[] = '<form method="POST">';
978 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
979 if (current_user_can( 'manage_options' )) {
980 $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>';
981 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
982 }
983 $content[] = '</div>';
984 $content[] = '</form>';
985 $content[] = '</div>';
986
987 $content[] = '</div>';
988
989 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
990
991 $content[] = '<div id="ays-chart-countdown-main-container">';
992 $content[] = '<div class="ays-chart-countdown-container">';
993 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
994 $content[] = esc_html__( "Offer ends in:", 'chart-builder' );
995
996 $content[] = '<ul style="padding: 0">';
997 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . esc_html__( 'Days', 'chart-builder' ) . '</li>';
998 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . esc_html__( 'Hours', 'chart-builder' ) . '</li>';
999 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . esc_html__( 'Minutes', 'chart-builder' ) . '</li>';
1000 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . esc_html__( 'Seconds', 'chart-builder' ) . '</li>';
1001 $content[] = '</ul>';
1002 $content[] = '</div>';
1003
1004 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1005 $content[] = '<span>🚀</span>';
1006 $content[] = '<span>⌛</span>';
1007 $content[] = '<span>🔥</span>';
1008 $content[] = '<span>💣</span>';
1009 $content[] = '</div>';
1010 $content[] = '</div>';
1011 $content[] = '</div>';
1012
1013 $content[] = '</div>';
1014
1015 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1016 $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>';
1017 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1018 $content[] = esc_html__( "One-time payment", 'chart-builder' );
1019 $content[] = '</span>';
1020 $content[] = '</div>';
1021
1022 $content[] = '</div>';
1023
1024 $content[] = '</div>';
1025
1026 $content = implode( '', $content );
1027 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1028 }
1029 }
1030
1031 // Helloween banner
1032 public static function ays_chart_helloween_message($ishmar){
1033 if($ishmar == 0 ){
1034 $content = array();
1035
1036 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1037 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
1038 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
1039
1040 $content[] = '<p>';
1041 $content[] = __( "Limited Time
1042 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
1043 <span>
1044 SALE on
1045 </span>
1046 <br>
1047 <span style='' class='ays-chart-helloween-bundle'>
1048 <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;'>
1049 Chart Builder
1050 </a>
1051 </span>", 'chart-builder' );
1052 $content[] = '</p>';
1053 $content[] = '<p>';
1054 $content[] = __( "Hurry up!
1055 <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;'>
1056 Check it out!
1057 </a>", 'chart-builder' );
1058 $content[] = '</p>';
1059
1060 $content[] = '</div>';
1061
1062
1063 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
1064 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
1065 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
1066 $content[] = '<div class="ays-chart-countdown-container-helloween">';
1067 $content[] = '<div id="ays-chart-countdown">';
1068 $content[] = '<ul>';
1069 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
1070 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
1071 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
1072 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
1073 $content[] = '</ul>';
1074 $content[] = '</div>';
1075
1076 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1077 $content[] = '<span>🚀</span>';
1078 $content[] = '<span>⌛</span>';
1079 $content[] = '<span>🔥</span>';
1080 $content[] = '<span>💣</span>';
1081 $content[] = '</div>';
1082
1083 $content[] = '</div>';
1084
1085 $content[] = '</div>';
1086
1087 $content[] = '</div>';
1088 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1089 $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>';
1090 $content[] = '</div>';
1091 $content[] = '</div>';
1092
1093 $content[] = '</div>';
1094
1095 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1096 $content[] = '<form method="POST">';
1097 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1098 if( current_user_can( 'manage_options' ) ){
1099 $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>';
1100 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1101 }
1102 $content[] = '</div>';
1103 $content[] = '</form>';
1104
1105 $content[] = '</div>';
1106 // $content[] = '<button type="button" class="notice-dismiss">';
1107 // $content[] = '</button>';
1108 $content[] = '</div>';
1109
1110 $content = implode( '', $content );
1111
1112 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1113 }
1114 }
1115
1116 // Black Friday banner
1117 public static function ays_chart_black_friday_message($ishmar){
1118 if($ishmar == 0 ){
1119 $content = array();
1120
1121 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1122 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1123 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1124 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1125 $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>';
1126 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1127 $content[] = '</div>';
1128
1129 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1130 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1131 $content[] = '</div>';
1132
1133 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1134 $content[] = '<div id="ays-chart-countdown-main-container">';
1135 $content[] = '<div class="ays-chart-countdown-container">';
1136 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1137 $content[] = '<ul>';
1138 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1139 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1140 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1141 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1142 $content[] = '</ul>';
1143 $content[] = '</div>';
1144 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1145 $content[] = '<span>🚀</span>';
1146 $content[] = '<span>⌛</span>';
1147 $content[] = '<span>🔥</span>';
1148 $content[] = '<span>💣</span>';
1149 $content[] = '</div>';
1150 $content[] = '</div>';
1151 $content[] = '</div>';
1152 $content[] = '</div>';
1153
1154 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1155 $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>';
1156 $content[] = '</div>';
1157 $content[] = '</div>';
1158 $content[] = '</div>';
1159
1160 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1161 $content[] = '<form method="POST">';
1162 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1163 if( current_user_can( 'manage_options' ) ){
1164 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1165 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1166 }
1167 $content[] = '</div>';
1168 $content[] = '</form>';
1169 $content[] = '</div>';
1170 $content[] = '</div>';
1171
1172 $content = implode( '', $content );
1173
1174 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1175 }
1176 }
1177
1178 // Christmas banner
1179 public static function ays_chart_christmas_message($ishmar){
1180 if($ishmar == 0 ){
1181 $content = array();
1182
1183 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1184 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1185 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1186 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1187 $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>';
1188 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', 'chart-builder' ) . '</div>';
1189 $content[] = '</div>';
1190
1191 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1192 $content[] = '<div id="ays-chart-countdown-main-container">';
1193 $content[] = '<div class="ays-chart-countdown-container">';
1194 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1195 $content[] = '<ul>';
1196 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', 'chart-builder' ) . '</li>';
1197 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', 'chart-builder' ) . '</li>';
1198 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', 'chart-builder' ) . '</li>';
1199 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', 'chart-builder' ) . '</li>';
1200 $content[] = '</ul>';
1201 $content[] = '</div>';
1202 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1203 $content[] = '<span>🚀</span>';
1204 $content[] = '<span>⌛</span>';
1205 $content[] = '<span>🔥</span>';
1206 $content[] = '<span>💣</span>';
1207 $content[] = '</div>';
1208 $content[] = '</div>';
1209 $content[] = '</div>';
1210 $content[] = '</div>';
1211
1212 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1213 $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>';
1214 $content[] = '</div>';
1215 $content[] = '</div>';
1216 $content[] = '</div>';
1217
1218 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1219 $content[] = '<form method="POST">';
1220 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1221 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', 'chart-builder' ) . '</button>';
1222 $content[] = '</div>';
1223 $content[] = '</form>';
1224 $content[] = '</div>';
1225 $content[] = '</div>';
1226
1227 $content = implode( '', $content );
1228
1229 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1230 }
1231 }
1232
1233 // Silver Bundle
1234 public function ays_chart_silver_bundle_message($ishmar){
1235 if($ishmar == 0 ){
1236 $content = array();
1237
1238 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1239 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1240 $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
1241
1242 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1243
1244 $content[] = '<strong style="font-weight: bold;">';
1245 $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' );
1246 $content[] = '</strong>';
1247
1248 $content[] = '<br>';
1249
1250 $content[] = '<strong>';
1251 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", 'chart-builder' );
1252 $content[] = '</strong>';
1253
1254 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1255
1256 $content[] = '<form method="POST">';
1257 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1258 $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>';
1259 $content[] = '</div>';
1260 $content[] = '</form>';
1261
1262 $content[] = '</div>';
1263
1264 $content[] = '</div>';
1265
1266 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1267
1268 $content[] = '<div id="ays-chart-countdown-main-container">';
1269 $content[] = '<div class="ays-chart-countdown-container">';
1270
1271 $content[] = '<div id="ays-chart-countdown">';
1272 $content[] = '<ul>';
1273 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1274 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1275 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1276 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1277 $content[] = '</ul>';
1278 $content[] = '</div>';
1279
1280 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1281 $content[] = '<span>🚀</span>';
1282 $content[] = '<span>⌛</span>';
1283 $content[] = '<span>🔥</span>';
1284 $content[] = '<span>💣</span>';
1285 $content[] = '</div>';
1286
1287 $content[] = '</div>';
1288 $content[] = '</div>';
1289
1290 $content[] = '</div>';
1291
1292 $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>';
1293 $content[] = '</div>';
1294 $content[] = '</div>';
1295
1296 $content = implode( '', $content );
1297 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1298 }
1299 }
1300
1301 // Black Friday 2024
1302 public function ays_chart_black_friday_message_2024($ishmar){
1303 if($ishmar == 0 ){
1304 $content = array();
1305
1306 $content[] = '<div id="ays-chart-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1307 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1308
1309 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1310
1311 $content[] = '<div id="ays-chart-countdown-main-container">';
1312 $content[] = '<div class="ays-chart-countdown-container">';
1313
1314 $content[] = '<div id="ays-chart-countdown">';
1315
1316 $content[] = '<div>';
1317 $content[] = __( "Offer ends in:", 'chart-builder' );
1318 $content[] = '</div>';
1319
1320 $content[] = '<ul>';
1321 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1322 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1323 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1324 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1325 $content[] = '</ul>';
1326 $content[] = '</div>';
1327
1328 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1329 $content[] = '<span>🚀</span>';
1330 $content[] = '<span>⌛</span>';
1331 $content[] = '<span>🔥</span>';
1332 $content[] = '<span>💣</span>';
1333 $content[] = '</div>';
1334
1335 $content[] = '</div>';
1336 $content[] = '</div>';
1337
1338 $content[] = '</div>';
1339
1340 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1341 $content[] = '<div>';
1342
1343 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1344 $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' );
1345 $content[] = '</span>';
1346
1347 $content[] = '</br>';
1348
1349 $content[] = '<span class="ays-chart-black-friday-bundle-desc">';
1350 $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">';
1351 $content[] = __( "50% OFF", 'chart-builder' );
1352 $content[] = '</a>';
1353 $content[] = '</span>';
1354 $content[] = '</div>';
1355
1356 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1357
1358 $content[] = '<form action="" method="POST">';
1359 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1360 if( current_user_can( 'manage_options' ) ){
1361 $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>';
1362 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1363 }
1364 $content[] = '</div>';
1365 $content[] = '</form>';
1366
1367 $content[] = '</div>';
1368
1369 $content[] = '</div>';
1370
1371 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1372 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1373 $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">';
1374 $content[] = __( 'Silver Bundle', 'chart-builder' );
1375 $content[] = '</a>';
1376 $content[] = '</span>';
1377 $content[] = '</div>';
1378
1379 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1380 $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>';
1381 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1382 $content[] = __( "One-time payment", 'chart-builder' );
1383 $content[] = '</span>';
1384 $content[] = '</div>';
1385 $content[] = '</div>';
1386 $content[] = '</div>';
1387
1388 $content = implode( '', $content );
1389 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1390 }
1391 }
1392
1393 //silver bundle
1394 public function ays_chart_new_silver_bundle_message_2025($ishmar){
1395 if($ishmar == 0 ){
1396 $content = array();
1397
1398 $content[] = '<div id="ays-chart-new-silver-bundle-2025-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1399 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1400
1401 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1402 $content[] = '<div>';
1403
1404 $content[] = '<span class="ays-chart-new-silver-bundle-2025-title">';
1405 $content[] = __( "<span><a href='https://ays-pro.com/silver-bundle' target='_blank' style='color:#ffffff; text-decoration: underline;'>Silver Bundle</a></span> (Quiz + Form + Chart)", 'quiz-maker' );
1406 $content[] = '</span>';
1407
1408 $content[] = '</br>';
1409
1410 $content[] = '<span class="ays-chart-new-silver-bundle-2025-desc">';
1411 $content[] = __( "30 Day Money Back Guarantee", 'chart-builder' );
1412 $content[] = '</span>';
1413 $content[] = '</div>';
1414
1415 $content[] = '<div>';
1416 $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;">';
1417 $content[] = '</div>';
1418
1419 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1420
1421 $content[] = '<form action="" method="POST">';
1422 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1423 if( current_user_can( 'manage_options' ) ){
1424 $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>';
1425 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1426 }
1427 $content[] = '</div>';
1428 $content[] = '</form>';
1429
1430 $content[] = '</div>';
1431
1432 $content[] = '</div>';
1433
1434 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1435
1436 $content[] = '<div id="ays-chart-countdown-main-container">';
1437 $content[] = '<div class="ays-chart-countdown-container">';
1438
1439 $content[] = '<div id="ays-chart-countdown">';
1440
1441 $content[] = '<ul>';
1442 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1443 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1444 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1445 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1446 $content[] = '</ul>';
1447 $content[] = '</div>';
1448
1449 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1450 $content[] = '<span></span>';
1451 $content[] = '<span></span>';
1452 $content[] = '<span></span>';
1453 $content[] = '<span></span>';
1454 $content[] = '</div>';
1455
1456 $content[] = '</div>';
1457 $content[] = '</div>';
1458
1459 $content[] = '</div>';
1460
1461 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1462 $content[] = '<a href="https://ays-pro.com/silver-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'chart-builder' ) . '</a>';
1463 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1464 $content[] = __( "One-time payment", 'chart-builder' );
1465 $content[] = '</span>';
1466 $content[] = '</div>';
1467 $content[] = '</div>';
1468 $content[] = '</div>';
1469
1470 $content = implode( '', $content );
1471 echo wp_kses_post($content);
1472 }
1473 }
1474
1475
1476 // Christmas Top Banner 2024
1477 public function ays_chart_christmas_message_2024($ishmar){
1478 if($ishmar == 0 ){
1479 $content = array();
1480
1481 $content[] = '<div id="ays-chart-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1482 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1483
1484 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1485
1486 $content[] = '<div id="ays-chart-countdown-main-container">';
1487 $content[] = '<div class="ays-chart-countdown-container">';
1488
1489 $content[] = '<div id="ays-chart-countdown">';
1490
1491 $content[] = '<div>';
1492 $content[] = __( "Offer ends in:", 'chart-builder' );
1493 $content[] = '</div>';
1494
1495 $content[] = '<ul style="padding-left: 0;">';
1496 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1497 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1498 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1499 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1500 $content[] = '</ul>';
1501 $content[] = '</div>';
1502
1503 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1504 $content[] = '<span>🚀</span>';
1505 $content[] = '<span>⌛</span>';
1506 $content[] = '<span>🔥</span>';
1507 $content[] = '<span>💣</span>';
1508 $content[] = '</div>';
1509
1510 $content[] = '</div>';
1511 $content[] = '</div>';
1512
1513 $content[] = '</div>';
1514
1515 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1516 $content[] = '<div>';
1517
1518 $content[] = '<span class="ays-chart-christmas-top-bundle-title">';
1519 $content[] = sprintf(
1520 /* translators: %s is the Chart Builder plugin URL with version parameter. */
1521 __(
1522 "<span><a href='%s' class='ays-chart-christmas-top-bundle-title-link' target='_blank'>Christmas Sale</a></span>",
1523 'chart-builder'
1524 ),
1525 "https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" . CHART_BUILDER_VERSION
1526 );
1527 $content[] = '</span>';
1528
1529 $content[] = '</br>';
1530
1531 $content[] = '<span class="ays-chart-christmas-top-bundle-desc">';
1532 $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">';
1533 $content[] = __( "20% Extra OFF", 'chart-builder' );
1534 $content[] = '</a>';
1535 $content[] = '</span>';
1536 $content[] = '</div>';
1537
1538 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1539
1540 $content[] = '<form action="" method="POST">';
1541 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1542 if( current_user_can( 'manage_options' ) ){
1543 $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>';
1544 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1545 }
1546 $content[] = '</div>';
1547 $content[] = '</form>';
1548
1549 $content[] = '</div>';
1550
1551 $content[] = '</div>';
1552
1553 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-christmas-top-bundle-coupon-text-box">';
1554 $content[] = '<div class="ays-chart-christmas-top-bundle-coupon-row">';
1555 $content[] = 'xmas20off';
1556 $content[] = '</div>';
1557 $content[] = '<div class="ays-chart-christmas-top-bundle-text-row">';
1558 $content[] = __( '20% Extra Discount Coupon', 'chart-builder' );
1559 $content[] = '</div>';
1560 $content[] = '</div>';
1561
1562 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1563 $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>';
1564 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1565 $content[] = __( "One-time payment", 'chart-builder' );
1566 $content[] = '</span>';
1567 $content[] = '</div>';
1568 $content[] = '</div>';
1569 $content[] = '</div>';
1570
1571 $content = implode( '', $content );
1572 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1573 }
1574 }
1575
1576 public function ays_chart_update_banner_time(){
1577
1578 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1579 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1580 $next_3_days = gmdate('M d, Y H:i:s', $date);
1581
1582 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1583
1584 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1585 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1586 }
1587
1588 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1589
1590 $val = 60*60*24*0.5; // half day
1591 // $val = 60; // for testing | 1 min
1592
1593 $current_date = current_time( 'mysql' );
1594 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1595
1596 $days_diff = $date_diff / $val;
1597 if(intval($days_diff) > 0 ){
1598 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1599 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1600 }
1601
1602 return $get_ays_chart_banner_time;
1603 }
1604
1605 public function author_user_search() {
1606 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1607 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
1608 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1609 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1610 $args = 'search=';
1611 if ($search !== null) {
1612 $args .= '*';
1613 $args .= $search;
1614 $args .= '*';
1615 }
1616
1617 $users = get_users($args);
1618
1619 $content_text = array(
1620 'results' => array()
1621 );
1622
1623 foreach ($users as $key => $value) {
1624 if ($checked !== null) {
1625 if ( !is_array( $checked ) ) {
1626 $checked2 = $checked;
1627 $checked = array();
1628 $checked[] = absint($checked2);
1629 }
1630 if (in_array($value->ID, $checked)) {
1631 continue;
1632 } else {
1633 $content_text['results'][] = array(
1634 'id' => $value->ID,
1635 'text' => $value->data->display_name,
1636 );
1637 }
1638 } else {
1639 $content_text['results'][] = array(
1640 'id' => $value->ID,
1641 'text' => $value->data->display_name,
1642 );
1643 }
1644 }
1645
1646 ob_end_clean();
1647 echo json_encode($content_text);
1648 wp_die();
1649 }
1650
1651 /**
1652 * Determine if the plugin/addon installations are allowed.
1653 *
1654 * @since 6.4.0.4
1655 *
1656 * @param string $type Should be `plugin` or `addon`.
1657 *
1658 * @return bool
1659 */
1660 public static function ays_chart_can_install( $type ) {
1661
1662 return self::ays_chart_can_do( 'install', $type );
1663 }
1664
1665 /**
1666 * Determine if the plugin/addon activations are allowed.
1667 *
1668 * @since 6.4.0.4
1669 *
1670 * @param string $type Should be `plugin` or `addon`.
1671 *
1672 * @return bool
1673 */
1674 public static function ays_chart_can_activate( $type ) {
1675
1676 return self::ays_chart_can_do( 'activate', $type );
1677 }
1678
1679 /**
1680 * Determine if the plugin/addon installations/activations are allowed.
1681 *
1682 * @since 6.4.0.4
1683 *
1684 * @param string $what Should be 'activate' or 'install'.
1685 * @param string $type Should be `plugin` or `addon`.
1686 *
1687 * @return bool
1688 */
1689 public static function ays_chart_can_do( $what, $type ) {
1690
1691 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1692 return false;
1693 }
1694
1695 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1696 return false;
1697 }
1698
1699 $capability = $what . '_plugins';
1700
1701 if ( ! current_user_can( $capability ) ) {
1702 return false;
1703 }
1704
1705 // Determine whether file modifications are allowed and it is activation permissions checking.
1706 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1707 return false;
1708 }
1709
1710 // All plugin checks are done.
1711 if ( $type === 'plugin' ) {
1712 return true;
1713 }
1714 return false;
1715 }
1716
1717 /**
1718 * Activate plugin.
1719 *
1720 * @since 1.0.0
1721 * @since 6.4.0.4 Updated the permissions checking.
1722 */
1723 public function ays_chart_activate_plugin() {
1724
1725 // Run a security check.
1726 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1727 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1728 }
1729
1730 // Check for permissions.
1731 if ( ! current_user_can( 'activate_plugins' ) ) {
1732 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1733 }
1734
1735 $type = 'addon';
1736
1737 if ( isset( $_POST['plugin'] ) ) {
1738
1739 if ( ! empty( $_POST['type'] ) ) {
1740 $type = sanitize_key( $_POST['type'] );
1741 }
1742
1743 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1744 $activate = activate_plugins( $plugin );
1745
1746 if ( ! is_wp_error( $activate ) ) {
1747 if ( $type === 'plugin' ) {
1748 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1749 } else {
1750 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1751 }
1752 }
1753 }
1754
1755 if ( $type === 'plugin' ) {
1756 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1757 }
1758
1759 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1760 }
1761
1762 /**
1763 * Install addon.
1764 *
1765 * @since 1.0.0
1766 * @since 6.4.0.4 Updated the permissions checking.
1767 */
1768 public function ays_chart_install_plugin() {
1769
1770 // Run a security check.
1771 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1772 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1773 }
1774
1775 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1776 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1777
1778 // Check if new installations are allowed.
1779 if ( ! self::ays_chart_can_install( $type ) ) {
1780 wp_send_json_error( $generic_error );
1781 }
1782
1783 $error = $type === 'plugin'
1784 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1785 : "";
1786
1787 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1788
1789 if ( empty( $plugin_url ) ) {
1790 wp_send_json_error( $error );
1791 }
1792
1793 // Prepare variables.
1794 $url = esc_url_raw(
1795 add_query_arg(
1796 [
1797 'page' => 'chart-builder-featured-plugins',
1798 ],
1799 admin_url( 'admin.php' )
1800 )
1801 );
1802
1803 ob_start();
1804 $creds = request_filesystem_credentials( $url, '', false, false, null );
1805
1806 // Hide the filesystem credentials form.
1807 ob_end_clean();
1808
1809 // Check for file system permissions.
1810 if ( $creds === false ) {
1811 wp_send_json_error( $error );
1812 }
1813
1814 if ( ! WP_Filesystem( $creds ) ) {
1815 wp_send_json_error( $error );
1816 }
1817
1818 /*
1819 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1820 */
1821 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1822 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1823 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1824
1825
1826 // Do not allow WordPress to search/download translations, as this will break JS output.
1827 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1828
1829 // Create the plugin upgrader with our custom skin.
1830 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1831
1832 // Error check.
1833 if ( ! method_exists( $installer, 'install' ) ) {
1834 wp_send_json_error( $error );
1835 }
1836
1837 $installer->install( $plugin_url );
1838
1839 // Flush the cache and return the newly installed plugin basename.
1840 wp_cache_flush();
1841
1842 $plugin_basename = $installer->plugin_info();
1843
1844 if ( empty( $plugin_basename ) ) {
1845 wp_send_json_error( $error );
1846 }
1847
1848 $result = array(
1849 'msg' => $generic_error,
1850 'is_activated' => false,
1851 'basename' => $plugin_basename,
1852 );
1853
1854 // Check for permissions.
1855 if ( ! current_user_can( 'activate_plugins' ) ) {
1856 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1857
1858 wp_send_json_success( $result );
1859 }
1860
1861 // Activate the plugin silently.
1862 $activated = activate_plugin( $plugin_basename );
1863 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1864
1865 if ( ! is_wp_error( $activated ) ) {
1866
1867 $result['is_activated'] = true;
1868 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1869
1870 wp_send_json_success( $result );
1871 }
1872
1873 // Fallback error just in case.
1874 wp_send_json_error( $result );
1875 }
1876
1877 /**
1878 * List of AM plugins that we propose to install.
1879 *
1880 * @since 6.4.0.4
1881 *
1882 * @return array
1883 */
1884 protected function get_am_plugins() {
1885 if ( !isset( $_SESSION ) ) {
1886 session_start();
1887 }
1888
1889 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1890
1891 $plugin_slug = array(
1892 'quiz-maker',
1893 'survey-maker',
1894 'poll-maker',
1895 'ays-popup-box',
1896 'secure-copy-content-protection',
1897 'gallery-photo-gallery',
1898 'ays-chatgpt-assistant',
1899 'easy-form',
1900 );
1901
1902 $plugin_url_arr = array();
1903 foreach ($plugin_slug as $key => $slug) {
1904 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1905 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1906 $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])) : "";
1907 } else {
1908 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1909 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1910 if ( $latest_version != '' ) {
1911 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1912 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1913 }
1914 }
1915
1916 $plugin_url_arr[$slug] = $plugin_url;
1917 }
1918
1919 $plugins_array = array(
1920 'quiz-maker/quiz-maker.php' => array(
1921 'icon' => $images_url . 'icon-quiz-128x128.png',
1922 'name' => __( 'Quiz Maker', 'chart-builder' ),
1923 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', 'chart-builder' ),
1924 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', 'chart-builder' ),
1925 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1926 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1927 'url' => $plugin_url_arr['quiz-maker'],
1928 ),
1929 'survey-maker/survey-maker.php' => array(
1930 'icon' => $images_url . 'icon-survey-128x128.png',
1931 'name' => __( 'Survey Maker', 'chart-builder' ),
1932 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1933 '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' ),
1934 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1935 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1936 'url' => $plugin_url_arr['survey-maker'],
1937 ),
1938 'poll-maker/poll-maker-ays.php' => array(
1939 'icon' => $images_url . 'icon-poll-128x128.png',
1940 'name' => __( 'Poll Maker', 'chart-builder' ),
1941 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1942 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1943 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1944 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1945 'url' => $plugin_url_arr['poll-maker'],
1946 ),
1947 'ays-popup-box/ays-pb.php' => array(
1948 'icon' => $images_url . 'icon-popup-128x128.png',
1949 'name' => __( 'Popup Box', 'chart-builder' ),
1950 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1951 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1952 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1953 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1954 'url' => $plugin_url_arr['ays-popup-box'],
1955 ),
1956 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1957 'icon' => $images_url . 'icon-sccp-128x128.png',
1958 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1959 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1960 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1961 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1962 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1963 'url' => $plugin_url_arr['secure-copy-content-protection'],
1964 ),
1965 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1966 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1967 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1968 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1969 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1970 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1971 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1972 'url' => $plugin_url_arr['gallery-photo-gallery'],
1973 ),
1974 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1975 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1976 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1977 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
1978 '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' ),
1979 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
1980 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
1981 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
1982 ),
1983 'easy-form/easy-form.php' => array(
1984 'icon' => $images_url . 'icon-form-128x128.png',
1985 'name' => __( 'Easy Form', 'chart-builder' ),
1986 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
1987 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
1988 'wporg' => 'https://wordpress.org/plugins/easy-form/',
1989 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
1990 'url' => $plugin_url_arr['easy-form'],
1991 ),
1992 );
1993
1994 return $plugins_array;
1995 }
1996
1997 protected function ays_chart_get_latest_plugin_version( $slug ){
1998
1999 if ( is_null( $slug ) || empty($slug) ) {
2000 return "";
2001 }
2002
2003 $version_latest = "";
2004
2005 if ( ! function_exists( 'plugins_api' ) ) {
2006 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
2007 }
2008
2009 // set the arguments to get latest info from repository via API ##
2010 $args = array(
2011 'slug' => $slug,
2012 'fields' => array(
2013 'version' => true,
2014 )
2015 );
2016
2017 /** Prepare our query */
2018 $call_api = plugins_api( 'plugin_information', $args );
2019
2020 /** Check for Errors & Display the results */
2021 if ( is_wp_error( $call_api ) ) {
2022 $api_error = $call_api->get_error_message();
2023 } else {
2024
2025 //echo $call_api;
2026 // everything ##
2027 if ( ! empty( $call_api->version ) ) {
2028 $version_latest = $call_api->version;
2029 }
2030 }
2031
2032 return $version_latest;
2033 }
2034
2035 /**
2036 * Get AM plugin data to display in the Addons section of About tab.
2037 *
2038 * @since 6.4.0.4
2039 *
2040 * @param string $plugin Plugin slug.
2041 * @param array $details Plugin details.
2042 * @param array $all_plugins List of all plugins.
2043 *
2044 * @return array
2045 */
2046 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
2047
2048 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
2049 $show_pro = false;
2050
2051 $plugin_data = array();
2052
2053 if ( $have_pro ) {
2054 if ( array_key_exists( $plugin, $all_plugins ) ) {
2055 if ( is_plugin_active( $plugin ) ) {
2056 $show_pro = true;
2057 }
2058 }
2059 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
2060 $show_pro = true;
2061 }
2062 if ( $show_pro ) {
2063 $plugin = $details['pro']['plug'];
2064 $details = $details['pro'];
2065 }
2066 }
2067
2068 if ( array_key_exists( $plugin, $all_plugins ) ) {
2069 if ( is_plugin_active( $plugin ) ) {
2070 // Status text/status.
2071 $plugin_data['status_class'] = 'status-active';
2072 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
2073 // Button text/status.
2074 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
2075 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
2076 $plugin_data['plugin_src'] = esc_attr( $plugin );
2077 } else {
2078 // Status text/status.
2079 $plugin_data['status_class'] = 'status-installed';
2080 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
2081 // Button text/status.
2082 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2083 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
2084 $plugin_data['plugin_src'] = esc_attr( $plugin );
2085 }
2086 } else {
2087 // Doesn't exist, install.
2088 // Status text/status.
2089 $plugin_data['status_class'] = 'status-missing';
2090
2091 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
2092 $plugin_data['status_class'] = 'status-go-to-url';
2093 }
2094 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
2095 // Button text/status.
2096 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2097 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
2098 $plugin_data['plugin_src'] = esc_url( $details['url'] );
2099 }
2100
2101 $plugin_data['details'] = $details;
2102
2103 return $plugin_data;
2104 }
2105
2106 /**
2107 * Display the Addons section of About tab.
2108 *
2109 * @since 6.4.0.4
2110 */
2111 public function output_about_addons() {
2112
2113 if ( ! function_exists( 'get_plugins' ) ) {
2114 require_once ABSPATH . 'wp-admin/includes/plugin.php';
2115 }
2116
2117 $all_plugins = get_plugins();
2118 $am_plugins = $this->get_am_plugins();
2119 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
2120 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
2121
2122 $content = '';
2123 $content.= '<div class="ays-chart-cards-block">';
2124 foreach ( $am_plugins as $plugin => $details ){
2125
2126 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
2127 $plugin_ready_to_activate = $can_activate_plugins
2128 && isset( $plugin_data['status_class'] )
2129 && $plugin_data['status_class'] === 'status-installed';
2130 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
2131 || $plugin_data['status_class'] !== 'status-active';
2132
2133 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
2134
2135 $plugin_action_class_disbaled = "";
2136 if ( strpos($plugin_action_class, 'status-active') !== false ) {
2137 $plugin_action_class_disbaled = "disbaled='true'";
2138 }
2139
2140 $content .= '
2141 <div class="ays-chart-card">
2142 <div class="ays-chart-card__content flexible">
2143 <div class="ays-chart-card__content-img-box">
2144 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
2145 </div>
2146 <div class="ays-chart-card__text-block">
2147 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
2148 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
2149 <span class="ays-chart-card__text-hidden">
2150 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
2151 </span>
2152 </p>
2153 </div>
2154 </div>
2155 <div class="ays-chart-card__footer">';
2156 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
2157 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
2158 '. wp_kses_post( $plugin_data['action_text'] ) .'
2159 </button>';
2160 }
2161 elseif ( $plugin_not_activated ) {
2162 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
2163 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
2164 <span aria-hidden="true" class="dashicons dashicons-external"></span>
2165 </a>';
2166 }
2167 $content .='
2168 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', 'chart-builder') .'</a>
2169 </div>
2170 </div>';
2171 }
2172 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
2173 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
2174 $content.= '</div>';
2175
2176 echo html_entity_decode($content);
2177 }
2178
2179 /**
2180 * Returns the data from Quiz maker.
2181 *
2182 * @access public
2183 */
2184 public function fetch_quiz_maker_data(){
2185 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
2186
2187 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2188 if ( !isset($params) || empty($params) ) {
2189 return array(
2190 'success' => false,
2191 'data' => array(
2192 'msg' => __( "Something went wrong.", "chart-builder" )
2193 )
2194 );
2195 }
2196
2197 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2198 if ( $query == '' ) {
2199 return array(
2200 'success' => false,
2201 'data' => array(
2202 'msg' => __( "No data given.", "chart-builder" )
2203 )
2204 );
2205 }
2206 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
2207 $user_id = get_current_user_id();
2208
2209 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
2210
2211 if (empty($return_results)) {
2212 return array(
2213 'success' => false,
2214 'data' => array(
2215 'msg' => __( "Something went wrong.", "chart-builder" )
2216 )
2217 );
2218 }
2219
2220 $result_values = $return_results['result'];
2221 $query = $return_results['query'];
2222
2223 if (empty($result_values)) {
2224 return array(
2225 'success' => false,
2226 'data' => array(
2227 'msg' => $return_results['message']
2228 )
2229 );
2230 }
2231
2232 if (count($return_results['result'][0]) != 1 ) {
2233 $results = array();
2234 $headers = array();
2235 if ( $result_values ) {
2236 $row_num = 0;
2237 foreach ( $result_values as $row ) {
2238 $result = array();
2239 foreach ( $row as $k => $v ) {
2240 $result[] = $v;
2241 if ( $row_num === 0 ) {
2242 $headers[] = $k;
2243 }
2244 }
2245 $results[] = $result;
2246 $row_num++;
2247 }
2248 }
2249 } else if (count($return_results['result'][0]) == 1) {
2250 $results = array();
2251 $headers = array();
2252 if ( $result_values ) {
2253 $row_num = 0;
2254 foreach ( $result_values as $index => $row ) {
2255 $result = array();
2256 foreach ( $row as $k => $v ) {
2257 $result[] = strval($index) + 1;
2258 $result[] = $v;
2259 if ( $row_num === 0 ) {
2260 $headers[] = 'Quiz';
2261 $headers[] = $k;
2262 }
2263 }
2264 $results[] = $result;
2265 $row_num++;
2266 }
2267 }
2268 }
2269
2270 if (empty($results)) {
2271 return array(
2272 'success' => false,
2273 'data' => array(
2274 'msg' => $return_results['message']
2275 )
2276 );
2277 }
2278
2279 foreach ($results as $key => $value) {
2280 if (!isset($value) || count($value) <= 1 && $key != 0) {
2281 unset($results[$key]);
2282 }
2283 }
2284
2285 array_unshift($results, $headers);
2286 $results = array_values( $results );
2287 $data = $results;
2288
2289 $headers = $results[0];
2290 unset( $results[0] );
2291
2292 $html = CBFunctions()->get_table_html( $headers, $results );
2293
2294 return array(
2295 'success' => true,
2296 'data' => array(
2297 'table' => $html,
2298 'data' => $data
2299 )
2300 );
2301 }
2302
2303 /**
2304 * Saves the Quiz maker data.
2305 *
2306 * @access public
2307 */
2308 public function save_quiz_maker_data() {
2309 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2310
2311 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2312 if ( !isset($params) || empty($params) ) {
2313 return array(
2314 'success' => false,
2315 'data' => array(
2316 'msg' => __( "Something went wrong.", "chart-builder" )
2317 )
2318 );
2319 }
2320
2321 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2322 if ( $query_id == '' ) {
2323 return array(
2324 'success' => false,
2325 'data' => array(
2326 'msg' => __( "No data given.", "chart-builder" )
2327 )
2328 );
2329 }
2330
2331 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2332 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2333 $user_id = get_current_user_id();
2334
2335 if ( $chart_id >= 0 ) {
2336
2337 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2338
2339 if (empty($return_results)) {
2340 return array(
2341 'success' => false,
2342 'data' => array(
2343 'msg' => __( "Something went wrong.", "chart-builder" )
2344 )
2345 );
2346 }
2347
2348 $result_values = $return_results['result'];
2349 $query = $return_results['query'];
2350
2351 if (empty($result_values)) {
2352 return array(
2353 'success' => false,
2354 'data' => array(
2355 'msg' => $return_results['message']
2356 )
2357 );
2358 }
2359
2360 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2361 $results = array();
2362 $headers = array();
2363 if ( $result_values ) {
2364 $row_num = 0;
2365 foreach ( $result_values as $row ) {
2366 $result = array();
2367 foreach ( $row as $k => $v ) {
2368 $result[] = $v;
2369 if ( $row_num === 0 ) {
2370 $headers[] = $k;
2371 }
2372 }
2373 $results[] = $result;
2374 $row_num++;
2375 }
2376 }
2377 } else if (count($return_results['result'][0]) == 1) {
2378 $results = array();
2379 $headers = array();
2380 if ( $result_values ) {
2381 $row_num = 0;
2382 foreach ( $result_values as $index => $row ) {
2383 $result = array();
2384 foreach ( $row as $k => $v ) {
2385 $result[] = strval($index) + 1;
2386 $result[] = $v;
2387 if ( $row_num === 0 ) {
2388 $headers[] = 'Quiz';
2389 $headers[] = $k;
2390 }
2391 }
2392 $results[] = $result;
2393 $row_num++;
2394 }
2395 }
2396 }
2397
2398 $source_type = 'quiz_maker';
2399 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2400 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2401
2402 update_option( $option_name_for_data, array(
2403 'source_type' => $source_type,
2404 'source' => $query,
2405 'data' => $results,
2406 ) );
2407 update_option( $option_name_for_quiz, array(
2408 'quiz_query' => $query_id,
2409 'quiz_id' => $quiz_id
2410 ) );
2411
2412 } else {
2413 return array(
2414 'success' => false,
2415 'data' => array(
2416 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2417 )
2418 );
2419 }
2420
2421 return array(
2422 'success' => true,
2423 'data' => array(
2424 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2425 )
2426 );
2427 }
2428
2429 /**
2430 * Chart page action hooks
2431 */
2432
2433 /**
2434 * Chart page sources contents
2435 * @param $args
2436 */
2437 public function ays_chart_page_source_contents( $args ){
2438 $chart_source_type = $args['chart_source_type'];
2439
2440 if ($chart_source_type === 'chart-js') {
2441 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2442 } else {
2443 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2444 }
2445
2446 $source_type = $args['source_type'];
2447
2448 $sources = array();
2449 foreach ( $sources_contents as $key => $sources_content ) {
2450 $collapsed = $key == $source_type ? 'false' : 'true';
2451
2452 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2453 if( isset( $sources_content['title'] ) ){
2454 $content .= '<legend class="ays-accordion-options-header">';
2455 $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">
2456 <g>
2457 <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" />
2458 </g>
2459 </svg>';
2460
2461 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2462 }
2463
2464 $content .= '<div class="ays-accordion-options-content">';
2465 $content .= $sources_content['content'];
2466 $content .= '</div>';
2467
2468 $content .= '</fieldset>';
2469
2470 $sources[] = $content;
2471 }
2472 $content_for_escape = implode('' , $sources );
2473 echo html_entity_decode( esc_html($content_for_escape) );
2474 }
2475
2476 public function source_contents_import_from_csv_settings( $sources, $args ){
2477 $html_class_prefix = $args['html_class_prefix'];
2478 $html_name_prefix = $args['html_name_prefix'];
2479
2480 ob_start();
2481 ?>
2482 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2483 <div class="ays-pro-features-v2-big-buttons-box">
2484 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2485 <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>
2486 <div class="ays-pro-features-v2-video-text">
2487 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2488 </div>
2489 </a>
2490 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2491 <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>
2492 <div class="ays-pro-features-v2-upgrade-text">
2493 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2494 </div>
2495 </a>
2496 </div>
2497 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap">
2498 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2499 <h6><?php echo esc_html__("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2500 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2501 <option value="csv">CSV File</option>
2502 </select>
2503 <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>
2504 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2505 <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>
2506 </p>
2507 <div>
2508 <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" />
2509 </div>
2510 <div class='ays-chart-file-import-success'></div>
2511 <div class='ays-chart-file-import-error'></div>
2512 <div class="ays-chart-buttons-group">
2513 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2514 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2515 </button>
2516 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2517 <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>
2518 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2519 </button>
2520 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2521 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2522 </button>
2523 </div>
2524 </div>
2525 </div>
2526 </div>
2527 <?php
2528 $content = ob_get_clean();
2529
2530 $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") . '">
2531 <i class="ays_fa ays_fa_info_circle"></i>
2532 </a>';
2533
2534 $sources['file_import'] = array(
2535 'content' => $content,
2536 'title' => $title
2537 );
2538
2539 return $sources;
2540 }
2541
2542 public function source_contents_import_from_db_settings( $sources, $args ){
2543 $html_class_prefix = $args['html_class_prefix'];
2544 $html_name_prefix = $args['html_name_prefix'];
2545
2546 ob_start();
2547 ?>
2548 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2549 <div class="ays-pro-features-v2-big-buttons-box">
2550 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2551 <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>
2552 <div class="ays-pro-features-v2-video-text">
2553 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2554 </div>
2555 </a>
2556 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2557 <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>
2558 <div class="ays-pro-features-v2-upgrade-text">
2559 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2560 </div>
2561 </a>
2562 </div>
2563 <div class="<?php echo esc_attr( $html_class_prefix ) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2564 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2565 <div id="ays-chart-db-query">
2566 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2567 <div id="db-query-form">
2568 <input type="hidden" name="chart_id" value="1">
2569 <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>
2570 <div class='db-wizard-success'></div>
2571 <div class='db-wizard-error'></div>
2572 </div>
2573 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2574 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2575 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2576 </button>
2577 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2578 <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>
2579 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2580 </button>
2581 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2582 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2583 </button>
2584 </div>
2585 </div>
2586 <div class="db-wizard-hints">
2587 <ul>
2588 <!-- <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> -->
2589 <li>
2590 <?php
2591 echo sprintf(
2592 /* translators: %1$s and %2$s are HTML span tags for styling. */
2593 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2594 '<span class="ays-chart-emboss">',
2595 '</span>'
2596 );
2597 ?>
2598 </li>
2599 </ul>
2600 </div>
2601 </div>
2602 </div>
2603 </div>
2604 </div>
2605 <?php
2606 $content = ob_get_clean();
2607
2608 $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') . '">
2609 <i class="ays_fa ays_fa_info_circle"></i>
2610 </a>';
2611
2612 $sources['import_from_db'] = array(
2613 'content' => $content,
2614 'title' => $title
2615 );
2616
2617 return $sources;
2618 }
2619
2620 public function source_contents_import_from_external_db_settings( $sources, $args ){
2621 $html_class_prefix = $args['html_class_prefix'];
2622 $html_name_prefix = $args['html_name_prefix'];
2623
2624 ob_start();
2625 ?>
2626 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2627 <div class="ays-pro-features-v2-big-buttons-box">
2628 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2629 <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>
2630 <div class="ays-pro-features-v2-upgrade-text">
2631 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2632 </div>
2633 </a>
2634 </div>
2635 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2636 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2637 <div class="form-group row mb-2">
2638 <div class="col-sm-8 <?php echo esc_attr($html_class_prefix) ?>option-title">
2639 <label class="form-label">
2640 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2641 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2642 <i class="ays_fa ays_fa_info_circle"></i>
2643 </a>
2644 </label>
2645 </div>
2646 <div class="col-sm-3 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2647 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2648 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2649 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2650 </label>
2651 </div>
2652 </div>
2653 <div id="ays-chart-external-db-query">
2654 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2655 <div id="external-db-query-form">
2656 <input type="hidden" name="chart_id" value="1">
2657 <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>
2658 <div class='db-wizard-success'></div>
2659 <div class='db-wizard-error'></div>
2660 </div>
2661 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2662 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2663 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2664 </button>
2665 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2666 <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>
2667 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2668 </button>
2669 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2670 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2671 </button>
2672 </div>
2673 </div>
2674 <div class="db-wizard-hints">
2675 <ul>
2676 <!-- <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> -->
2677 <li>
2678 <?php
2679 echo sprintf(
2680 /* translators: %1$s and %2$s are HTML span tags for styling. */
2681 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2682 '<span class="ays-chart-emboss">',
2683 '</span>'
2684 );
2685 ?>
2686 </li>
2687 </ul>
2688 </div>
2689 </div>
2690 </div>
2691 </div>
2692 </div>
2693 <?php
2694 $content = ob_get_clean();
2695
2696 $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') . '">
2697 <i class="ays_fa ays_fa_info_circle"></i>
2698 </a>';
2699
2700 $sources['import_from_external_db'] = array(
2701 'content' => $content,
2702 'title' => $title
2703 );
2704
2705 return $sources;
2706 }
2707
2708 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2709 global $wpdb;
2710 $chart_id = $args['chart_id'];
2711 $html_class_prefix = $args['html_class_prefix'];
2712 $html_name_prefix = $args['html_name_prefix'];
2713 $source = $args['source'];
2714 $settings = $args['settings'];
2715 $quiz_queries = $args['quiz_queries'];
2716 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2717 $quiz_id = $args['quiz_id'];
2718 $quiz_query = $args['quiz_query'];
2719
2720 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2721 // $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") . '">
2722 // <i class="ays_fa ays_fa_info_circle"></i>
2723 // </a>', '<br>', '<b>', '</b>');
2724 // $content = $this->blockquote_content_quiz;
2725 // $sources['quiz_maker'] = array(
2726 // 'content' => $content,
2727 // 'title' => $title
2728 // );
2729
2730 return $sources;
2731 }
2732 $quizes = $wpdb->get_results( // phpcs:ignore
2733 $wpdb->prepare(
2734 "SELECT `title`, `id` FROM {$wpdb->prefix}aysquiz_quizes
2735 WHERE `published` = %d AND `question_ids` <> %s",
2736 1,
2737 ''
2738 ),
2739 ARRAY_A
2740 );
2741
2742
2743 ob_start();
2744 ?>
2745 <div class="ays-accordion-data-main-wrap">
2746 <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">
2747 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2748 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?php echo esc_attr($chart_id) ?>">
2749 <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">
2750 <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' ) ?>">
2751 <i class="ays_fa ays_fa_info_circle"></i>
2752 </a>
2753 <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">
2754 <option value=""><?php echo esc_html__( "Select query", "chart-builder" ) ?></option>
2755 <?php foreach ( $quiz_queries as $id => $q):
2756 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2757 <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>
2758 <?php endforeach; ?>
2759 </select>
2760 </div>
2761 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2762 <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">
2763 <option value="0"><?php echo esc_html__( "Select quiz", "chart-builder" ) ?></option>
2764 <?php foreach ( $quizes as $quiz): ?>
2765 <option value="<?php echo esc_attr($quiz['id']) ?>" <?php echo $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?php echo esc_html($quiz['title'] )?></option>
2766 <?php endforeach; ?>
2767 </select>
2768 </div>
2769 <div id="ays-chart-quiz-maker-success"></div>
2770 <div id="ays-chart-quiz-maker-error"></div>
2771 <div class="ays-chart-buttons-group">
2772 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2773 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2774 </button>
2775 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2776 <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>
2777 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2778 </button>
2779 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2780 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2781 </button>
2782 </div>
2783 </div>
2784 <div>
2785 <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>
2786 </div>
2787 </div>
2788 </div>
2789 <?php
2790 $content = ob_get_clean();
2791
2792 $title = sprintf(
2793 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2794 __( 'Get Quiz Maker data', 'chart-builder' ) .
2795 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2796 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2797 __( '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' ) . '">
2798 <i class="ays_fa ays_fa_info_circle"></i>
2799 </a>',
2800 '<br>', '<b>', '</b>'
2801 );
2802 $sources['quiz_maker'] = array(
2803 'content' => $content,
2804 'title' => $title
2805 );
2806
2807 return $sources;
2808 }
2809
2810 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2811 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2812 return $sources;
2813 }
2814
2815 $chart_id = $args['chart_id'];
2816 $html_class_prefix = $args['html_class_prefix'];
2817 $html_name_prefix = $args['html_name_prefix'];
2818 ob_start();
2819 ?>
2820 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2821 <div class="ays-pro-features-v2-big-buttons-box">
2822 <div class="ays-pro-features-v2-video-button"></div>
2823 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2824 <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>
2825 <div class="ays-pro-features-v2-upgrade-text">
2826 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2827 </div>
2828 </a>
2829 </div>
2830 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap ">
2831 <div id="ays-chart-woocommerce-datas">
2832 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-form">
2833 <div id="woocommerce-datas-form">
2834 <input type="hidden" name="chart_id" value="<?php echo esc_attr( $chart_id )?>">
2835 <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" >
2836 <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' ) ?>">
2837 <i class="ays_fa ays_fa_info_circle"></i>
2838 </a>
2839 <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]">
2840 <option value=""><?php echo esc_html__( 'Select query', 'chart-builder') ?></option>
2841 </select>
2842 </div>
2843 <div class='ays-chart-woocommerce-datas-success'></div>
2844 <div class='ays-chart-woocommerce-datas-error'></div>
2845 </div>
2846 <div class="ays-chart-buttons-group">
2847 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2848 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2849 </button>
2850 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2851 <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>
2852 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2853 </button>
2854 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2855 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2856 </button>
2857 </div>
2858 </div>
2859 </div>
2860 </div>
2861 </div>
2862 <?php
2863 $content = ob_get_clean();
2864
2865 $title = sprintf(
2866 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2867 esc_html__( 'Get WooCommerce data', 'chart-builder' ) .
2868 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2869 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2870 __( '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' ) . '">
2871 <i class="ays_fa ays_fa_info_circle"></i>
2872 </a>',
2873 '<br>', '<b>', '</b>'
2874 );
2875 $sources['woocommerce'] = array(
2876 'content' => $content,
2877 'title' => $title
2878 );
2879
2880 return $sources;
2881 }
2882
2883 public function source_contents_manual_settings( $sources, $args ){
2884 $html_class_prefix = $args['html_class_prefix'];
2885 $html_name_prefix = $args['html_name_prefix'];
2886 $source = $args['source'];
2887 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2888 $settings = $args['settings'];
2889 $source_chart_type = $args['source_chart_type'];
2890 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
2891 $action = isset($_GET['action']) ? sanitize_text_field(wp_unslash($_GET['action'])) : 'add';
2892
2893 if (isset($source) && !empty($source)) {
2894 if ( !isset( $source[0] ) ) {
2895 if (count($source[1]) > 2) {
2896 $titles = array();
2897 for ($i = 0; $i < count($source[1]); $i++) {
2898 array_push($titles, __("Title", 'chart-builder').$i);
2899 }
2900 $source[0] = $titles;
2901 } else {
2902 $source[0] = array(
2903 __("Country", 'chart-builder'),
2904 __("Population", 'chart-builder'),
2905 );
2906 }
2907
2908 ksort($source);
2909 }
2910 }
2911
2912 if ($action == 'add') {
2913 foreach ($source as $key => $row) {
2914 $source[$key] = array_slice($row, 0, 2);
2915 }
2916 } else if ($action == 'edit') {
2917 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2918 foreach ($source as $key => $row) {
2919 $source[$key] = array_slice($row, 0, 2);
2920 }
2921 }
2922 }
2923 ob_start();
2924 ?>
2925 <div class="ays-accordion-data-main-wrap">
2926 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2927 <?php if($source_chart_type != 'org_chart'): ?>
2928 <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">
2929 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2930 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2931 </div> -->
2932 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2933 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2934 <?php if(!empty($source)):
2935 foreach($source as $source_id => $source_value):
2936 if(!empty($source_value) ):
2937 if ($source_id == 0): ?>
2938 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2939 <div class="ays-chart-empty-data-table-cell"></div>
2940 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2941 <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); ?>">
2942 <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">
2943 <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;" />
2944 </svg>
2945 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2946 <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'" : "" ?>>
2947 <?php if ($each_source_id !== 0): ?>
2948 <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">
2949 <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;" />
2950 </svg>
2951 <?php endif; ?>
2952 </div>
2953 </div>
2954 <?php endforeach; ?>
2955 </div>
2956 <?php else: ?>
2957 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2958 <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">
2959 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2960 <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;" />
2961 </svg>
2962 </div>
2963 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
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-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
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>
2968 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2969 <?php if ($each_source_id == 0): ?>
2970 <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); ?>">
2971 <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)); ?>">
2972 </div>
2973 <?php else: ?>
2974 <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); ?>">
2975 <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">
2976 </div>
2977 <?php endif; ?>
2978 <?php endforeach; ?>
2979 </div>
2980 <?php endif; ?>
2981 <?php endif; ?>
2982 <?php endforeach; ?>
2983 <?php else:?>
2984 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
2985 <div style="height: 63.11px; padding: 0 15px;"></div>
2986 <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">
2987 <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">
2988 <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;" />
2989 </svg>
2990 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2991 <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'>
2992 <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">
2993 <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;" />
2994 </svg>
2995 </div>
2996 </div>
2997 </div>
2998 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2999 <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">
3000 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3001 <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" />
3002 </svg>
3003 </div>
3004 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3005 <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">
3006 <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;" />
3007 </svg>
3008 </div>
3009 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3010 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3011 </div>
3012 <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">
3013 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3014 </div>
3015 </div>
3016 <?php endif; ?>
3017 </div>
3018 <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">
3019 <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">
3020 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3021 </div>
3022 </div>
3023 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3024 <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">
3025 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3026 </div>
3027 <br>
3028 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3029 <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>
3030 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3031 </button>
3032 </div>
3033 <?php endif; ?>
3034 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
3035 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-org-type">
3036 <ul id="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-tree-content">
3037 </ul>
3038 </div>
3039 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3040 <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>
3041 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3042 </button>
3043 </div>
3044 </div>
3045 </div>
3046 <?php
3047 $content = ob_get_clean();
3048
3049 $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") . '">
3050 <i class="ays_fa ays_fa_info_circle"></i>
3051 </a>';
3052
3053 $sources['manual'] = array(
3054 'content' => $content,
3055 'title' => $title
3056 );
3057
3058 return $sources;
3059 }
3060
3061 public function source_contents_manual_settings_chartjs( $sources, $args ){
3062 $html_class_prefix = $args['html_class_prefix'];
3063 $html_name_prefix = $args['html_name_prefix'];
3064 $source = $args['source'];
3065 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
3066 $settings = $args['settings'];
3067 $source_chart_type = $args['source_chart_type'];
3068 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
3069 $action = isset($_GET['action']) ? sanitize_text_field((wp_unslash($_GET['action']))) : 'add';
3070
3071 ob_start();
3072 ?>
3073 <div class="ays-accordion-data-main-wrap">
3074 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
3075 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr($html_class_prefix) ?>chart-source-data-manual">
3076 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
3077 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
3078 <?php if(!empty($source)):
3079 foreach($source as $source_id => $source_value):
3080 if(!empty($source_value) ):
3081 if ($source_id == 0): ?>
3082 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3083 <div class="ays-chart-empty-data-table-cell"></div>
3084 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3085 <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); ?>">
3086 <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">
3087 <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;" />
3088 </svg>
3089 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3090 <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'" : "" ?>>
3091 <?php if ($each_source_id !== 0): ?>
3092 <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">
3093 <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;" />
3094 </svg>
3095 <?php endif; ?>
3096 </div>
3097 </div>
3098 <?php endforeach; ?>
3099 </div>
3100 <?php else: ?>
3101 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3102 <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">
3103 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3104 <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;" />
3105 </svg>
3106 </div>
3107 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
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-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
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>
3112 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3113 <?php if ($each_source_id == 0): ?>
3114 <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); ?>">
3115 <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)); ?>">
3116 </div>
3117 <?php else: ?>
3118 <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); ?>">
3119 <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">
3120 </div>
3121 <?php endif; ?>
3122 <?php endforeach; ?>
3123 </div>
3124 <?php endif; ?>
3125 <?php endif; ?>
3126 <?php endforeach; ?>
3127 <?php else:?>
3128 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
3129 <div style="height: 63.11px; padding: 0 15px;"></div>
3130 <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">
3131 <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">
3132 <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;" />
3133 </svg>
3134 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3135 <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'>
3136 <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">
3137 <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;" />
3138 </svg>
3139 </div>
3140 </div>
3141 </div>
3142 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
3143 <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">
3144 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3145 <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" />
3146 </svg>
3147 </div>
3148 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3149 <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">
3150 <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;" />
3151 </svg>
3152 </div>
3153 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3154 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3155 </div>
3156 <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">
3157 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3158 </div>
3159 </div>
3160 <?php endif; ?>
3161 </div>
3162 <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">
3163 <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">
3164 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3165 </div>
3166 </div>
3167 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3168 <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">
3169 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3170 </div>
3171 <br>
3172 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3173 <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>
3174 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3175 </button>
3176 </div>
3177 </div>
3178 </div>
3179 <?php
3180 $content = ob_get_clean();
3181
3182 $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") . '">
3183 <i class="ays_fa ays_fa_info_circle"></i>
3184 </a>';
3185
3186 $sources['manual'] = array(
3187 'content' => $content,
3188 'title' => $title
3189 );
3190
3191 return $sources;
3192 }
3193
3194 /**
3195 * Chart page settings contents
3196 * @param $args
3197 */
3198 public function ays_chart_page_settings_contents( $args ){
3199 $chart_source_type = $args['chart_source_type'];
3200
3201 if ($chart_source_type === 'chart-js') {
3202 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
3203 } else {
3204 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
3205 }
3206
3207 $sources = array();
3208 foreach ( $sources_contents as $key => $sources_content ) {
3209 $collapsed = $key == 'general_settings' ? 'false' : 'true';
3210
3211 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
3212 if(isset($sources_content['title'])){
3213 $content .= '<legend class="ays-accordion-options-header">';
3214 $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">
3215 <g>
3216 <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" />
3217 </g>
3218 </svg>';
3219
3220 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
3221 }
3222
3223 $content .= '<div class="ays-accordion-options-content">';
3224 $content .= $sources_content['content'];
3225 $content .= '</div>';
3226
3227 $content .= '</fieldset>';
3228
3229 $sources[] = $content;
3230 }
3231 $content_for_escape = implode('' , $sources );
3232 echo html_entity_decode( $content_for_escape );
3233 }
3234
3235 public function settings_contents_general_settings( $sources, $args ){
3236 $html_class_prefix = $args['html_class_prefix'];
3237 $html_name_prefix = $args['html_name_prefix'];
3238 $chart_description = $args['chart_description'];
3239 $create_author_data = $args['create_author_data'];
3240 $status = $args['status'];
3241 $settings = $args['settings'];
3242
3243 $show_title = $settings['show_title'];
3244 $show_description = $settings['show_description'];
3245 $enable_interactivity = $settings['enable_interactivity'];
3246 $maximized_view = $settings['maximized_view'];
3247
3248 ob_start();
3249 ?>
3250 <div class="ays-accordion-data-main-wrap">
3251 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3252 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3253 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3254 <label for="ays-status" class="form-label">
3255 <?php echo esc_html(__('Status', "chart-builder")); ?>
3256 <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") ); ?>">
3257 <i class="ays_fa ays_fa_info_circle"></i>
3258 </a>
3259 </label>
3260 </div>
3261 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3262 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3263 <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' : ''; ?> >
3264 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3265 </label>
3266 </div>
3267 </div> <!-- Status -->
3268 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3269 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3270 <label for="ays-chart-description" class="form-label">
3271 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3272 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3273 <i class="ays_fa ays_fa_info_circle"></i>
3274 </a>
3275 </label>
3276 </div>
3277 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3278 <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>
3279 </div>
3280 </div> <!-- Chart description -->
3281 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3282 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3283 <label for="ays-chart-create-author" class="form-label">
3284 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3285 <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")); ?>">
3286 <i class="ays_fa ays_fa_info_circle"></i>
3287 </a>
3288 </label>
3289 </div>
3290 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3291 <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">
3292 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3293 <?php if (isset($create_author_data['ID'])) : ?>
3294 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3295 <?php endif; ?>
3296 </select>
3297 </div>
3298 </div> <!-- Change chart author -->
3299 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3300 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3301 <label for="ays-chart-show-title" class="form-label">
3302 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3303 <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") ); ?>">
3304 <i class="ays_fa ays_fa_info_circle"></i>
3305 </a>
3306 </label>
3307 </div>
3308 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3309 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3310 <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); ?> >
3311 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3312 </label>
3313 </div>
3314 </div> <!-- Show title -->
3315 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3316 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3317 <label for="ays-chart-show-description" class="form-label">
3318 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3319 <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") ); ?>">
3320 <i class="ays_fa ays_fa_info_circle"></i>
3321 </a>
3322 </label>
3323 </div>
3324 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3325 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3326 <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); ?> >
3327 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3328 </label>
3329 </div>
3330 </div> <!-- Show description -->
3331 <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">
3332 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3333 <label for="ays-chart-option-enable-interactivity" class="form-label">
3334 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3335 <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") ); ?>">
3336 <i class="ays_fa ays_fa_info_circle"></i>
3337 </a>
3338 </label>
3339 </div>
3340 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3341 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3342 <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); ?> >
3343 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3344 </label>
3345 </div>
3346 </div> <!-- Enable interactivity -->
3347 <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">
3348 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3349 <label for="ays-chart-option-maximized-view" class="form-label">
3350 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3351 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3352 <i class="ays_fa ays_fa_info_circle"></i>
3353 </a>
3354 </label>
3355 </div>
3356 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3357 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3358 <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); ?> >
3359 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3360 </label>
3361 </div>
3362 </div> <!-- Maximized view -->
3363 </div>
3364 </div>
3365 <?php
3366 $content = ob_get_clean();
3367
3368 $title = __( 'General Settings', "chart-builder" );
3369
3370 $sources['general_settings'] = array(
3371 'content' => $content,
3372 'title' => $title
3373 );
3374
3375 return $sources;
3376 }
3377
3378 public function settings_contents_general_settings_chartjs( $sources, $args ){
3379 $html_class_prefix = $args['html_class_prefix'];
3380 $html_name_prefix = $args['html_name_prefix'];
3381 $chart_description = $args['chart_description'];
3382 $create_author_data = $args['create_author_data'];
3383 $status = $args['status'];
3384 $settings = $args['settings'];
3385
3386 $show_title = $settings['show_title'];
3387 $show_description = $settings['show_description'];
3388
3389 ob_start();
3390 ?>
3391 <div class="ays-accordion-data-main-wrap">
3392 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3393 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3394 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3395 <label for="ays-status" class="form-label">
3396 <?php echo esc_html(__('Status', "chart-builder")); ?>
3397 <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") ); ?>">
3398 <i class="ays_fa ays_fa_info_circle"></i>
3399 </a>
3400 </label>
3401 </div>
3402 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3403 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3404 <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' : ''; ?> >
3405 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3406 </label>
3407 </div>
3408 </div> <!-- Status -->
3409 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3410 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3411 <label for="ays-chart-description" class="form-label">
3412 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3413 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3414 <i class="ays_fa ays_fa_info_circle"></i>
3415 </a>
3416 </label>
3417 </div>
3418 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3419 <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>
3420 </div>
3421 </div> <!-- Chart description -->
3422 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3423 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3424 <label for="ays-chart-create-author" class="form-label">
3425 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3426 <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")); ?>">
3427 <i class="ays_fa ays_fa_info_circle"></i>
3428 </a>
3429 </label>
3430 </div>
3431 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3432 <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">
3433 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3434 <?php if (isset($create_author_data['ID'])) : ?>
3435 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3436 <?php endif; ?>
3437 </select>
3438 </div>
3439 </div> <!-- Change chart author -->
3440 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3441 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3442 <label for="ays-chart-show-title" class="form-label">
3443 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3444 <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") ); ?>">
3445 <i class="ays_fa ays_fa_info_circle"></i>
3446 </a>
3447 </label>
3448 </div>
3449 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3450 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3451 <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); ?> >
3452 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3453 </label>
3454 </div>
3455 </div> <!-- Show title -->
3456 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3457 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3458 <label for="ays-chart-show-description" class="form-label">
3459 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3460 <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") ); ?>">
3461 <i class="ays_fa ays_fa_info_circle"></i>
3462 </a>
3463 </label>
3464 </div>
3465 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3466 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3467 <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); ?> >
3468 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3469 </label>
3470 </div>
3471 </div> <!-- Show description -->
3472 </div>
3473 </div>
3474 <?php
3475 $content = ob_get_clean();
3476
3477 $title = __( 'General Settings', "chart-builder" );
3478
3479 $sources['general_settings'] = array(
3480 'content' => $content,
3481 'title' => $title
3482 );
3483
3484 return $sources;
3485 }
3486
3487 public function settings_contents_tooltip_settings( $sources, $args ){
3488 $html_class_prefix = $args['html_class_prefix'];
3489 $html_name_prefix = $args['html_name_prefix'];
3490 $settings = $args['settings'];
3491
3492 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3493 $tooltip_trigger = $settings['tooltip_trigger'];
3494 $show_color_code = $settings['show_color_code'];
3495 $tooltip_italic = $settings['tooltip_italic'];
3496 $tooltip_bold = $settings['tooltip_bold'];
3497 $tooltip_bold_options = $settings['tooltip_bold_options'];
3498 $tooltip_text_color = $settings['tooltip_text_color'];
3499 $tooltip_font_size = $settings['tooltip_font_size'];
3500
3501 ob_start();
3502 ?>
3503 <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">
3504 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3505 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3506 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3507 <label for="ays-chart-option-tooltip-trigger">
3508 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3509 <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") )); ?>">
3510 <i class="ays_fa ays_fa_info_circle"></i>
3511 </a>
3512 </label>
3513 </div>
3514 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3515 <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]">
3516 <?php
3517 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3518 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3519 ?>
3520 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3521 <?php
3522 endforeach;
3523 ?>
3524 </select>
3525 </div>
3526 </div> <!-- Trigger -->
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-show-color-code">
3530 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3531 <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") ); ?>">
3532 <i class="ays_fa ays_fa_info_circle"></i>
3533 </a>
3534 </label>
3535 </div>
3536 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3537 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3538 <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); ?> >
3539 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3540 </label>
3541 </div>
3542 </div> <!-- Show Color Code -->
3543 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3544 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3545 <label for="ays-chart-option-tooltip-text-color">
3546 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3547 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3548 <i class="ays_fa ays_fa_info_circle"></i>
3549 </a>
3550 </label>
3551 </div>
3552 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3553 <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) ?>">
3554 </div>
3555 </div> <!-- Text color -->
3556 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3557 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3558 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3559 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3560 <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") )); ?>">
3561 <i class="ays_fa ays_fa_info_circle"></i>
3562 </a>
3563 </label>
3564 </div>
3565 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3566 <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) ?>">
3567 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3568 </div>
3569 </div> <!-- Font size -->
3570 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3571 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3572 <label for="ays-chart-option-tooltip-italic">
3573 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3574 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3575 <i class="ays_fa ays_fa_info_circle"></i>
3576 </a>
3577 </label>
3578 </div>
3579 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3580 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3581 <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); ?> >
3582 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3583 </label>
3584 </div>
3585 </div> <!-- Italic text -->
3586 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3587 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3588 <label for="ays-chart-option-tooltip-bold">
3589 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3590 <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") )); ?>">
3591 <i class="ays_fa ays_fa_info_circle"></i>
3592 </a>
3593 </label>
3594 </div>
3595 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3596 <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]">
3597 <?php
3598 foreach ( $tooltip_bold_options as $option_slug => $option ):
3599 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3600 ?>
3601 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3602 <?php
3603 endforeach;
3604 ?>
3605 </select>
3606 </div>
3607 </div> <!-- Bold text -->
3608 </div>
3609 </div>
3610 <?php
3611 $content = ob_get_clean();
3612
3613 $title = __( 'Tooltip', "chart-builder" );
3614
3615 $sources['tooltip'] = array(
3616 'content' => $content,
3617 'title' => $title
3618 );
3619
3620 return $sources;
3621 }
3622
3623 public function settings_contents_legend_settings( $sources, $args ){
3624 $html_class_prefix = $args['html_class_prefix'];
3625 $html_name_prefix = $args['html_name_prefix'];
3626 $settings = $args['settings'];
3627 $legend_positions = $settings['legend_positions'];
3628 $legend_position = $settings['legend_position'];
3629 $legend_alignments = $settings['legend_alignments'];
3630 $legend_alignment = $settings['legend_alignment'];
3631 $legend_color = $settings['legend_color'];
3632 $legend_font_size = $settings['legend_font_size'];
3633 $legend_bold = $settings['legend_bold'];
3634 $legend_italic = $settings['legend_italic'];
3635
3636 ob_start();
3637 ?>
3638 <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">
3639 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3640 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3641 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3642 <label for="ays-chart-option-legend-position">
3643 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3644 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
3645 <i class="ays_fa ays_fa_info_circle"></i>
3646 </a>
3647 </label>
3648 </div>
3649 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3650 <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]">
3651 <?php
3652 foreach ( $legend_positions as $option_slug => $option ):
3653 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3654
3655 $type_class = '';
3656 if ($option_slug == 'left') {
3657 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3658 } else if ($option_slug == 'in') {
3659 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3660 } else if ($option_slug == 'labeled') {
3661 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3662 }
3663
3664 ?>
3665
3666 <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>
3667 <?php
3668 endforeach;
3669 ?>
3670 </select>
3671 </div>
3672 </div> <!-- Legend position -->
3673 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3674 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3675 <label for="ays-chart-option-legend-alignment">
3676 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3677 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
3678 <i class="ays_fa ays_fa_info_circle"></i>
3679 </a>
3680 </label>
3681 </div>
3682 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3683 <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]">
3684 <?php
3685 foreach ( $legend_alignments as $option_slug => $option ):
3686 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3687 ?>
3688 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3689 <?php
3690 endforeach;
3691 ?>
3692 </select>
3693 </div>
3694 </div> <!-- Legend alignment -->
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-font-color">
3698 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3699 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color 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) ?>input-align-right">
3705 <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) ?>">
3706 </div>
3707 </div> <!-- Legend font color -->
3708 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3709 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3710 <label for="ays-chart-option-legend-font-size" class="form-label">
3711 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3712 <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") )); ?>">
3713 <i class="ays_fa ays_fa_info_circle"></i>
3714 </a>
3715 </label>
3716 </div>
3717 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3718 <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) ?>">
3719 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3720 </div>
3721 </div> <!-- Font size -->
3722 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3723 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3724 <label for="ays-chart-option-legend-italic">
3725 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3726 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3727 <i class="ays_fa ays_fa_info_circle"></i>
3728 </a>
3729 </label>
3730 </div>
3731 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3732 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3733 <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); ?> >
3734 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3735 </label>
3736 </div>
3737 </div> <!-- Italic text -->
3738 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3739 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3740 <label for="ays-chart-option-legend-bold">
3741 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3742 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3743 <i class="ays_fa ays_fa_info_circle"></i>
3744 </a>
3745 </label>
3746 </div>
3747 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3748 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3749 <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); ?> >
3750 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3751 </label>
3752 </div>
3753 </div> <!-- Bold text -->
3754 </div>
3755 </div>
3756 <?php
3757 $content = ob_get_clean();
3758
3759 $title = __( 'Legend', "chart-builder" );
3760
3761 $sources['legend'] = array(
3762 'content' => $content,
3763 'title' => $title
3764 );
3765
3766 return $sources;
3767 }
3768
3769 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3770 $html_class_prefix = $args['html_class_prefix'];
3771 $html_name_prefix = $args['html_name_prefix'];
3772 $settings = $args['settings'];
3773
3774 $haxis_title = $settings['haxis_title'];
3775 $axes_text_positions = $settings['axes_text_positions'];
3776 $haxis_text_position = $settings['haxis_text_position'];
3777 $haxis_direction = $settings['haxis_direction'];
3778 $haxis_text_color = $settings['haxis_text_color'];
3779 $haxis_baseline_color = $settings['haxis_baseline_color'];
3780 $haxis_slanted_options = $settings['haxis_slanted_options'];
3781 $haxis_slanted = $settings['haxis_slanted'];
3782 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3783 $haxis_show_text_every = $settings['haxis_show_text_every'];
3784 $haxis_format_options = $settings['axes_format_options'];
3785 $haxis_format = $settings['haxis_format'];
3786 $haxis_label_font_size = $settings['haxis_label_font_size'];
3787 $haxis_max_value = $settings['haxis_max_value'];
3788 $haxis_min_value = $settings['haxis_min_value'];
3789 $haxis_text_font_size = $settings['haxis_text_font_size'];
3790 $haxis_label_color = $settings['haxis_label_color'];
3791 $haxis_bold = $settings['haxis_bold'];
3792 $haxis_italic = $settings['haxis_italic'];
3793 $haxis_title_bold = $settings['haxis_title_bold'];
3794 $haxis_title_italic = $settings['haxis_title_italic'];
3795 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3796 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3797 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3798
3799 ob_start();
3800 ?>
3801 <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">
3802 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3803 <h6>Label</h6>
3804 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3805 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3806 <label for="ays-chart-option-haxis-title" class="form-label">
3807 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3808 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the horizontal axis","chart-builder") ); ?>">
3809 <i class="ays_fa ays_fa_info_circle"></i>
3810 </a>
3811 </label>
3812 </div>
3813 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3814 <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) ?>">
3815 </div>
3816 </div> <!-- Horizontal axis label -->
3817 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3818 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3819 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3820 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3821 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3822 <i class="ays_fa ays_fa_info_circle"></i>
3823 </a>
3824 </label>
3825 </div>
3826 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3827 <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) ?>">
3828 </div>
3829 </div> <!-- Horizontal axis label font size -->
3830 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3831 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3832 <label for="ays-chart-option-haxis-label-color">
3833 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3834 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3835 <i class="ays_fa ays_fa_info_circle"></i>
3836 </a>
3837 </label>
3838 </div>
3839 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3840 <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) ?>">
3841 </div>
3842 </div> <!-- Horizontal axis label color -->
3843 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3844 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3845 <label for="ays-chart-option-haxis-title-italic">
3846 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3847 <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") ); ?>">
3848 <i class="ays_fa ays_fa_info_circle"></i>
3849 </a>
3850 </label>
3851 </div>
3852 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3853 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3854 <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); ?> >
3855 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3856 </label>
3857 </div>
3858 </div> <!-- Italic label -->
3859 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3860 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3861 <label for="ays-chart-option-haxis-title-bold">
3862 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3863 <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") ); ?>">
3864 <i class="ays_fa ays_fa_info_circle"></i>
3865 </a>
3866 </label>
3867 </div>
3868 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3869 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3870 <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); ?> >
3871 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3872 </label>
3873 </div>
3874 </div> <!-- Bold label -->
3875 <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">
3876 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3877 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3878 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3879 <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") ); ?>">
3880 <i class="ays_fa ays_fa_info_circle"></i>
3881 </a>
3882 </label>
3883 </div>
3884 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3885 <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">
3886 </div>
3887 </div> <!-- Label interval -->
3888
3889 <br>
3890 <h6>Text</h6>
3891 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3892 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3893 <label for="ays-chart-option-haxis-text-position" class="form-label">
3894 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3895 <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") ); ?>">
3896 <i class="ays_fa ays_fa_info_circle"></i>
3897 </a>
3898 </label>
3899 </div>
3900 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3901 <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]">
3902 <?php
3903 foreach ( $axes_text_positions as $option_slug => $option ):
3904 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3905 ?>
3906 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3907 <?php
3908 endforeach;
3909 ?>
3910 </select>
3911 </div>
3912 </div> <!-- Horizontal axis text position -->
3913 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3914 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3915 <label for="ays-chart-option-haxis-text-color">
3916 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3917 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
3918 <i class="ays_fa ays_fa_info_circle"></i>
3919 </a>
3920 </label>
3921 </div>
3922 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3923 <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) ?>">
3924 </div>
3925 </div> <!-- Horizontal axis text color -->
3926 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3927 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3928 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
3929 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3930 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
3931 <i class="ays_fa ays_fa_info_circle"></i>
3932 </a>
3933 </label>
3934 </div>
3935 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3936 <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) ?>">
3937 </div>
3938 </div> <!-- Horizontal axis text font size -->
3939 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3940 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3941 <label for="ays-chart-option-haxis-text-direction">
3942 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3943 <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") ); ?>">
3944 <i class="ays_fa ays_fa_info_circle"></i>
3945 </a>
3946 </label>
3947 </div>
3948 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3949 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3950 <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); ?> >
3951 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3952 </label>
3953 </div>
3954 </div> <!-- Horizontal axis text direction -->
3955 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3956 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3957 <label for="ays-chart-option-haxis-italic">
3958 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3959 <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") ); ?>">
3960 <i class="ays_fa ays_fa_info_circle"></i>
3961 </a>
3962 </label>
3963 </div>
3964 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3965 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3966 <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); ?> >
3967 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3968 </label>
3969 </div>
3970 </div> <!-- Italic text -->
3971 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3972 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3973 <label for="ays-chart-option-haxis-bold">
3974 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3975 <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") ); ?>">
3976 <i class="ays_fa ays_fa_info_circle"></i>
3977 </a>
3978 </label>
3979 </div>
3980 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3981 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3982 <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); ?> >
3983 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3984 </label>
3985 </div>
3986 </div> <!-- Bold text -->
3987 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3988 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3989 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
3990 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
3991 <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") ); ?>">
3992 <i class="ays_fa ays_fa_info_circle"></i>
3993 </a>
3994 </label>
3995 </div>
3996 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3997 <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]">
3998 <?php
3999 foreach ( $haxis_slanted_options as $option_slug => $option ):
4000 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
4001 ?>
4002 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4003 <?php
4004 endforeach;
4005 ?>
4006 </select>
4007 </div>
4008 </div> <!-- Horizontal axis slanted text -->
4009 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
4010 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4011 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
4012 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
4013 <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") ); ?>">
4014 <i class="ays_fa ays_fa_info_circle"></i>
4015 </a>
4016 </label>
4017 </div>
4018 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4019 <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">
4020 </div>
4021 </div> <!-- Horizontal axis slanted text angle -->
4022
4023 <br>
4024 <h6>Gridlines</h6>
4025 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4026 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4027 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
4028 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4029 <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") ); ?>">
4030 <i class="ays_fa ays_fa_info_circle"></i>
4031 </a>
4032 </label>
4033 </div>
4034 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4035 <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) ?>">
4036 </div>
4037 </div> <!-- Horizontal axis gridlines count -->
4038 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4039 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4040 <label for="ays-chart-option-haxis-gridlines-color">
4041 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4042 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
4043 <i class="ays_fa ays_fa_info_circle"></i>
4044 </a>
4045 </label>
4046 </div>
4047 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4048 <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) ?>">
4049 </div>
4050 </div> <!-- Horizontal axis gridlines color -->
4051 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4052 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4053 <label for="ays-chart-option-haxis-minor-gridlines-color">
4054 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4055 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
4056 <i class="ays_fa ays_fa_info_circle"></i>
4057 </a>
4058 </label>
4059 </div>
4060 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4061 <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) ?>">
4062 </div>
4063 </div> <!-- Horizontal axis minor gridlines color -->
4064 <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">
4065 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4066 <label for="ays-chart-option-haxis-baseline-color">
4067 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4068 <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") ); ?>">
4069 <i class="ays_fa ays_fa_info_circle"></i>
4070 </a>
4071 </label>
4072 </div>
4073 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4074 <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) ?>">
4075 </div>
4076 </div> <!-- Horizontal axis baseline color -->
4077
4078 <br class="cb-changable-opt cb-bar_chart-opt cb-line_chart-opt" >
4079 <h6 class="cb-changable-opt cb-bar_chart-opt cb-line_chart-opt">Format</h6>
4080 <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" >
4081 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4082 <label for="ays-chart-option-haxis-format" class="form-label">
4083 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4084 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4085 echo esc_attr( sprintf(
4086 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4087 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4088 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4089 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4090 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4091 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4092 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4093 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4094 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4095 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4096 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4097 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4098 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4099 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4100 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4101 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4102 '<em>', '</em>',
4103 '<em>', '</em>',
4104 '<em>', '</em>',
4105 '<em>', '</em>',
4106 '<em>', '</em>',
4107 '<em>', '</em>',
4108 '<em>', '</em>'
4109 ));
4110 ?>">
4111 <i class="ays_fa ays_fa_info_circle"></i>
4112 </a>
4113 </label>
4114 </div>
4115 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4116 <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]">
4117 <?php
4118 foreach ( $haxis_format_options as $option_slug => $option ):
4119 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
4120 ?>
4121 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4122 <?php
4123 endforeach;
4124 ?>
4125 </select>
4126 </div>
4127 </div> <!-- Horizontal axis format -->
4128 <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" >
4129 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4130 <label for="ays-chart-option-haxis-max-value" class="form-label">
4131 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4132 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4133 <i class="ays_fa ays_fa_info_circle"></i>
4134 </a>
4135 </label>
4136 </div>
4137 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4138 <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) ?>">
4139 </div>
4140 </div> <!-- Horizontal axis max value -->
4141 <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" >
4142 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4143 <label for="ays-chart-option-haxis-min-value" class="form-label">
4144 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4145 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4146 <i class="ays_fa ays_fa_info_circle"></i>
4147 </a>
4148 </label>
4149 </div>
4150 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4151 <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) ?>">
4152 </div>
4153 </div> <!-- Horizontal axis min value -->
4154 </div>
4155 </div>
4156 <?php
4157 $content = ob_get_clean();
4158
4159 $title = __( 'Horizontal Axis Settings', "chart-builder" );
4160
4161 $sources['horizontal_axis'] = array(
4162 'content' => $content,
4163 'title' => $title
4164 );
4165
4166 return $sources;
4167 }
4168
4169 public function settings_contents_vertical_axis_settings( $sources, $args ){
4170 $html_class_prefix = $args['html_class_prefix'];
4171 $html_name_prefix = $args['html_name_prefix'];
4172 $settings = $args['settings'];
4173
4174 $vaxis_title = $settings['vaxis_title'];
4175 $axes_text_positions = $settings['axes_text_positions'];
4176 $vaxis_text_position = $settings['vaxis_text_position'];
4177 $vaxis_direction = $settings['vaxis_direction'];
4178 $vaxis_text_color = $settings['vaxis_text_color'];
4179 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
4180 $vaxis_format_options = $settings['axes_format_options'];
4181 $vaxis_format = $settings['vaxis_format'];
4182 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
4183 $vaxis_max_value = $settings['vaxis_max_value'];
4184 $vaxis_min_value = $settings['vaxis_min_value'];
4185 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
4186 $vaxis_label_color = $settings['vaxis_label_color'];
4187 $vaxis_bold = $settings['vaxis_bold'];
4188 $vaxis_italic = $settings['vaxis_italic'];
4189 $vaxis_title_bold = $settings['vaxis_title_bold'];
4190 $vaxis_title_italic = $settings['vaxis_title_italic'];
4191 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
4192 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
4193 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
4194
4195 ob_start();
4196 ?>
4197 <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">
4198 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4199 <h6>Label</h6>
4200 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4201 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4202 <label for="ays-chart-option-vaxis-title" class="form-label">
4203 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
4204 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the vertical axis","chart-builder") ); ?>">
4205 <i class="ays_fa ays_fa_info_circle"></i>
4206 </a>
4207 </label>
4208 </div>
4209 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4210 <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) ?>">
4211 </div>
4212 </div> <!-- Vertical axis label -->
4213 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4214 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4215 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
4216 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4217 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
4218 <i class="ays_fa ays_fa_info_circle"></i>
4219 </a>
4220 </label>
4221 </div>
4222 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4223 <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) ?>">
4224 </div>
4225 </div> <!-- Vertical axis label font size -->
4226 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4227 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4228 <label for="ays-chart-option-vaxis-label-color">
4229 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4230 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
4231 <i class="ays_fa ays_fa_info_circle"></i>
4232 </a>
4233 </label>
4234 </div>
4235 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4236 <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) ?>">
4237 </div>
4238 </div> <!-- Vertical axis label color -->
4239 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4240 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4241 <label for="ays-chart-option-vaxis-title-italic">
4242 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4243 <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") ); ?>">
4244 <i class="ays_fa ays_fa_info_circle"></i>
4245 </a>
4246 </label>
4247 </div>
4248 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4249 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4250 <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); ?> >
4251 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4252 </label>
4253 </div>
4254 </div> <!-- Italic label -->
4255 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4256 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4257 <label for="ays-chart-option-vaxis-title-bold">
4258 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4259 <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") ); ?>">
4260 <i class="ays_fa ays_fa_info_circle"></i>
4261 </a>
4262 </label>
4263 </div>
4264 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4265 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4266 <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); ?> >
4267 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4268 </label>
4269 </div>
4270 </div> <!-- Bold label -->
4271
4272 <br>
4273 <h6>Text</h6>
4274 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4275 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4276 <label for="ays-chart-option-vaxis-text-position" class="form-label">
4277 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4278 <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") ); ?>">
4279 <i class="ays_fa ays_fa_info_circle"></i>
4280 </a>
4281 </label>
4282 </div>
4283 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4284 <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]">
4285 <?php
4286 foreach ( $axes_text_positions as $option_slug => $option ):
4287 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
4288 ?>
4289 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4290 <?php
4291 endforeach;
4292 ?>
4293 </select>
4294 </div>
4295 </div> <!-- Vertical axis text position -->
4296 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4297 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4298 <label for="ays-chart-option-vaxis-text-color">
4299 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4300 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
4301 <i class="ays_fa ays_fa_info_circle"></i>
4302 </a>
4303 </label>
4304 </div>
4305 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4306 <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) ?>">
4307 </div>
4308 </div> <!-- Vertical axis text color -->
4309 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4310 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4311 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4312 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4313 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4314 <i class="ays_fa ays_fa_info_circle"></i>
4315 </a>
4316 </label>
4317 </div>
4318 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4319 <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) ?>">
4320 </div>
4321 </div> <!-- Vertical axis text font size -->
4322 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4323 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4324 <label for="ays-chart-option-vaxis-text-direction">
4325 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4326 <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") ); ?>">
4327 <i class="ays_fa ays_fa_info_circle"></i>
4328 </a>
4329 </label>
4330 </div>
4331 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4332 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4333 <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); ?> >
4334 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4335 </label>
4336 </div>
4337 </div> <!-- Vertical axis text direction -->
4338 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4339 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4340 <label for="ays-chart-option-vaxis-italic">
4341 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4342 <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") ); ?>">
4343 <i class="ays_fa ays_fa_info_circle"></i>
4344 </a>
4345 </label>
4346 </div>
4347 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4348 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4349 <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); ?> >
4350 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4351 </label>
4352 </div>
4353 </div> <!-- Italic text -->
4354 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4355 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4356 <label for="ays-chart-option-vaxis-bold">
4357 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4358 <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") ); ?>">
4359 <i class="ays_fa ays_fa_info_circle"></i>
4360 </a>
4361 </label>
4362 </div>
4363 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4364 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4365 <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); ?> >
4366 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4367 </label>
4368 </div>
4369 </div> <!-- Bold text -->
4370
4371 <br>
4372 <h6>Gridlines</h6>
4373 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4374 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4375 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
4376 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4377 <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") ); ?>">
4378 <i class="ays_fa ays_fa_info_circle"></i>
4379 </a>
4380 </label>
4381 </div>
4382 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4383 <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) ?>">
4384 </div>
4385 </div> <!-- Vertical axis gridlines count -->
4386 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4387 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4388 <label for="ays-chart-option-vaxis-gridlines-color">
4389 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4390 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4391 <i class="ays_fa ays_fa_info_circle"></i>
4392 </a>
4393 </label>
4394 </div>
4395 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4396 <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) ?>">
4397 </div>
4398 </div> <!-- Vertical axis gridlines color -->
4399 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4400 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4401 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4402 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4403 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4404 <i class="ays_fa ays_fa_info_circle"></i>
4405 </a>
4406 </label>
4407 </div>
4408 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4409 <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) ?>">
4410 </div>
4411 </div> <!-- Vertical axis minor gridlines color -->
4412 <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">
4413 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4414 <label for="ays-chart-option-vaxis-baseline-color">
4415 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4416 <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") ); ?>">
4417 <i class="ays_fa ays_fa_info_circle"></i>
4418 </a>
4419 </label>
4420 </div>
4421 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4422 <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) ?>">
4423 </div>
4424 </div> <!-- Vertical axis baseline color -->
4425
4426 <br class="cb-changable-opt cb-column_chart-opt ">
4427 <h6 class="cb-changable-opt cb-column_chart-opt">Format</h6>
4428 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt">
4429 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4430 <label for="ays-chart-option-vaxis-format" class="form-label">
4431 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4432 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4433 echo esc_attr( sprintf(
4434 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4435 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4436 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4437 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4438 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4439 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4440 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4441 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4442 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4443 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4444 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4445 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4446 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4447 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4448 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4449 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4450 '<em>', '</em>',
4451 '<em>', '</em>',
4452 '<em>', '</em>',
4453 '<em>', '</em>',
4454 '<em>', '</em>',
4455 '<em>', '</em>',
4456 '<em>', '</em>'
4457 ));
4458 ?>">
4459 <i class="ays_fa ays_fa_info_circle"></i>
4460 </a>
4461 </label>
4462 </div>
4463 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4464 <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]">
4465 <?php
4466 foreach ( $vaxis_format_options as $option_slug => $option ):
4467 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4468 ?>
4469 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4470 <?php
4471 endforeach;
4472 ?>
4473 </select>
4474 </div>
4475 </div> <!-- Vertical axis format -->
4476 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt">
4477 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4478 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4479 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4480 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4481 <i class="ays_fa ays_fa_info_circle"></i>
4482 </a>
4483 </label>
4484 </div>
4485 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4486 <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) ?>">
4487 </div>
4488 </div> <!-- Vertical axis max value -->
4489 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt">
4490 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4491 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4492 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4493 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4494 <i class="ays_fa ays_fa_info_circle"></i>
4495 </a>
4496 </label>
4497 </div>
4498 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4499 <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) ?>">
4500 </div>
4501 </div> <!-- Vertical axis min value -->
4502 </div>
4503 </div>
4504 <?php
4505 $content = ob_get_clean();
4506
4507 $title = __( 'Vertical Axis Settings', "chart-builder" );
4508
4509 $sources['vertical_axis'] = array(
4510 'content' => $content,
4511 'title' => $title
4512 );
4513
4514 return $sources;
4515 }
4516
4517 public function settings_contents_animation_settings( $sources, $args ) {
4518 $html_class_prefix = $args['html_class_prefix'];
4519 $html_name_prefix = $args['html_name_prefix'];
4520 $settings = $args['settings'];
4521
4522 $enable_animation = $settings['enable_animation'];
4523 $animation_duration = $settings['animation_duration'];
4524 $animation_startup = $settings['animation_startup'];
4525 $animation_easing_options = $settings['animation_easing_options'];
4526 $animation_easing = $settings['animation_easing'];
4527
4528 ob_start();
4529 ?>
4530 <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">
4531 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4532 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-enable-animation">
4535 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4536 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4537 <i class="ays_fa ays_fa_info_circle"></i>
4538 </a>
4539 </label>
4540 </div>
4541 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4542 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4543 <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); ?> >
4544 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4545 </label>
4546 </div>
4547 </div> <!-- Enable animation -->
4548 <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'; ?>">
4549 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4550 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4551 <label for="ays-chart-option-animation-duration" class="form-label">
4552 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4553 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4554 <i class="ays_fa ays_fa_info_circle"></i>
4555 </a>
4556 </label>
4557 </div>
4558 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4559 <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) ?>">
4560 </div>
4561 </div> <!-- Animation duration -->
4562 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4563 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4564 <label for="ays-chart-option-animation-startup">
4565 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4566 <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") ); ?>">
4567 <i class="ays_fa ays_fa_info_circle"></i>
4568 </a>
4569 </label>
4570 </div>
4571 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4572 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4573 <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); ?> >
4574 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4575 </label>
4576 </div>
4577 </div> <!-- Animation startup -->
4578 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4579 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4580 <label for="ays-chart-option-animation-easing" class="form-label">
4581 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4582 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4583 echo esc_attr( sprintf(
4584 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4585 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4586 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4587 __('%1$sLinear:%2$s Constant speed.', "chart-builder") . "</li><li>" .
4588 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4589 __('%1$sEase in:%2$s Start slow and speed up.', "chart-builder") . "</li><li>" .
4590 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4591 __('%1$sEase out:%2$s Start fast and slow down.', "chart-builder") . "</li><li>" .
4592 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4593 __('%1$sEase in and out:%2$s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4594 '<em>', '</em>',
4595 '<em>', '</em>',
4596 '<em>', '</em>',
4597 '<em>', '</em>'
4598 ));
4599 ?>">
4600 <i class="ays_fa ays_fa_info_circle"></i>
4601 </a>
4602 </label>
4603 </div>
4604 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4605 <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]">
4606 <?php
4607 foreach ( $animation_easing_options as $option_slug => $option ):
4608 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4609 ?>
4610 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4611 <?php
4612 endforeach;
4613 ?>
4614 </select>
4615 </div>
4616 </div> <!-- Animation easing -->
4617 <div>
4618 </div>
4619 </div>
4620 <?php
4621 $content = ob_get_clean();
4622
4623 $title = __( 'Chart animation', "chart-builder" );
4624
4625 $sources['animation'] = array(
4626 'content' => $content,
4627 'title' => $title
4628 );
4629
4630 return $sources;
4631 }
4632
4633 public function settings_contents_live_chart_settings( $sources, $args ) {
4634 $html_class_prefix = $args['html_class_prefix'];
4635 $html_name_prefix = $args['html_name_prefix'];
4636
4637 ob_start();
4638 ?>
4639 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-live-chart-settings-tab">
4640 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4641 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4642 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4643 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4644 <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>
4645 <div class="ays-pro-features-v2-video-text">
4646 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4647 </div>
4648 </a>
4649 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4650 <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>
4651 <div class="ays-pro-features-v2-upgrade-text">
4652 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4653 </div>
4654 </a>
4655 </div>
4656 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4657 <label for="ays-chart-option-enable-live-chart">
4658 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4659 <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") ); ?>">
4660 <i class="ays_fa ays_fa_info_circle"></i>
4661 </a>
4662 </label>
4663 </div>
4664 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4665 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4666 <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">
4667 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4668 </label>
4669 </div>
4670 </div> <!-- Enable live chart -->
4671 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4672 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4673 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4674 <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>
4675 <div class="ays-pro-features-v2-video-text">
4676 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4677 </div>
4678 </a>
4679 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4680 <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>
4681 <div class="ays-pro-features-v2-upgrade-text">
4682 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4683 </div>
4684 </a>
4685 </div>
4686 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4687 <label for="ays-chart-option-live-chart-interval" class="form-label">
4688 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4689 <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") ); ?>">
4690 <i class="ays_fa ays_fa_info_circle"></i>
4691 </a>
4692 </label>
4693 </div>
4694 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4695 <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">
4696 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4697 </div>
4698 </div> <!-- Live chart interval -->
4699 </div>
4700 </div>
4701 <?php
4702 $content = ob_get_clean();
4703
4704 $title = __( 'Live Chart', "chart-builder" );
4705
4706 $sources['live_chart'] = array(
4707 'content' => $content,
4708 'title' => $title
4709 );
4710
4711 return $sources;
4712
4713 }
4714
4715 public function settings_contents_export_options( $sources, $args ){
4716 $html_class_prefix = $args['html_class_prefix'];
4717 $html_name_prefix = $args['html_name_prefix'];
4718 $settings = $args['settings'];
4719
4720 $enable_img = $settings['enable_img'];
4721
4722 ob_start();
4723 ?>
4724 <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">
4725 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4726 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4727 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4728 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4729 <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>
4730 <div class="ays-pro-features-v2-video-text">
4731 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4732 </div>
4733 </a>
4734 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4735 <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>
4736 <div class="ays-pro-features-v2-upgrade-text">
4737 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4738 </div>
4739 </a>
4740 </div>
4741 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4742 <label for="ays-chart-option-export-print">
4743 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4744 <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") ); ?>">
4745 <i class="ays_fa ays_fa_info_circle"></i>
4746 </a>
4747 </label>
4748 </div>
4749 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4750 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4751 <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">
4752 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4753 </label>
4754 </div>
4755 </div> <!-- Print option end -->
4756 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4757 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4758 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4759 <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>
4760 <div class="ays-pro-features-v2-video-text">
4761 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4762 </div>
4763 </a>
4764 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4765 <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>
4766 <div class="ays-pro-features-v2-upgrade-text">
4767 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4768 </div>
4769 </a>
4770 </div>
4771 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4772 <label for="ays-chart-option-export-Excel">
4773 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4774 <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") ); ?>">
4775 <i class="ays_fa ays_fa_info_circle"></i>
4776 </a>
4777 </label>
4778 </div>
4779 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4780 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4781 <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">
4782 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4783 </label>
4784 </div>
4785 </div> <!-- Excel option end -->
4786 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4787 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4788 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4789 <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>
4790 <div class="ays-pro-features-v2-video-text">
4791 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4792 </div>
4793 </a>
4794 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4795 <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>
4796 <div class="ays-pro-features-v2-upgrade-text">
4797 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4798 </div>
4799 </a>
4800 </div>
4801 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4802 <label for="ays-chart-option-export-CSV">
4803 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4804 <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") ); ?>">
4805 <i class="ays_fa ays_fa_info_circle"></i>
4806 </a>
4807 </label>
4808 </div>
4809 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4810 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4811 <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">
4812 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4813 </label>
4814 </div>
4815 </div> <!-- CSV option end -->
4816 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4817 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4818 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4819 <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>
4820 <div class="ays-pro-features-v2-video-text">
4821 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4822 </div>
4823 </a>
4824 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4825 <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>
4826 <div class="ays-pro-features-v2-upgrade-text">
4827 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4828 </div>
4829 </a>
4830 </div>
4831 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4832 <label for="ays-chart-option-export-Copy">
4833 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4834 <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") ); ?>">
4835 <i class="ays_fa ays_fa_info_circle"></i>
4836 </a>
4837 </label>
4838 </div>
4839 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4840 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4841 <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">
4842 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4843 </label>
4844 </div>
4845 </div> <!-- Copy option end -->
4846 <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">
4847 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4848 <label for="ays-chart-option-export-img">
4849 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4850 <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") ); ?>">
4851 <i class="ays_fa ays_fa_info_circle"></i>
4852 </a>
4853 </label>
4854 </div>
4855 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4856 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4857 <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)?> >
4858 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4859 </label>
4860 </div>
4861 </div> <!-- IMG option end -->
4862 </div>
4863 </div>
4864 <?php
4865
4866 $content = ob_get_clean();
4867
4868 $title = __( 'Frontend Actions', "chart-builder" );
4869
4870 $sources['export_options'] = array(
4871 'content' => $content,
4872 'title' => $title
4873 );
4874
4875 return $sources;
4876 }
4877
4878 /**
4879 * Chart page styles contents
4880 * @param $args
4881 */
4882 public function ays_chart_page_styles_contents( $args ){
4883 $chart_source_type = $args['chart_source_type'];
4884
4885 if ($chart_source_type === 'chart-js') {
4886 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4887 } else {
4888 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4889 }
4890
4891 $sources = array();
4892 foreach ( $sources_contents as $key => $sources_content ) {
4893 $collapsed = $key == 'chart' ? 'false' : 'true';
4894
4895 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4896 if(isset($sources_content['title'])){
4897 $content .= '<legend class="ays-accordion-options-header">';
4898 $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">
4899 <g>
4900 <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" />
4901 </g>
4902 </svg>';
4903
4904 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4905 }
4906
4907 $content .= '<div class="ays-accordion-options-content">';
4908 $content .= $sources_content['content'];
4909 $content .= '</div>';
4910
4911 $content .= '</fieldset>';
4912
4913 $sources[] = $content;
4914 }
4915 $content_for_escape = implode('' , $sources );
4916 echo html_entity_decode( esc_html($content_for_escape) );
4917 }
4918
4919 public function settings_contents_chart_styles_settings( $sources, $args ){
4920 $html_class_prefix = $args['html_class_prefix'];
4921 $html_name_prefix = $args['html_name_prefix'];
4922 $settings = $args['settings'];
4923
4924 $width = $settings['width'];
4925 $width_format = $settings['width_format'];
4926 $title_positions = $settings['title_positions'];
4927 $position = $settings['position'];
4928 $width_format_options = $settings['width_format_options'];
4929 $responsive_width = $settings['responsive_width'];
4930 $height = $settings['height'];
4931 $height_format = $settings['height_format'];
4932 $font_size = $settings['font_size'];
4933 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4934 $org_chart_font_size = $settings['org_chart_font_size'];
4935 $background_color = $settings['background_color'];
4936 $transparent_background = $settings['transparent_background'];
4937 $border_width = $settings['border_width'];
4938 $border_width_with_title = $settings['border_width_with_title'];
4939 $border_radius_with_title = $settings['border_radius_with_title'];
4940 $border_color_with_title = $settings['border_color_with_title'];
4941 $border_style_with_title = $settings['border_style_with_title'];
4942 $border_style = $settings['border_style'];
4943 $border_styles = $settings['border_styles'];
4944 $border_radius = $settings['border_radius'];
4945 $border_color = $settings['border_color'];
4946 $box_shadow = $settings['box_shadow'];
4947 $box_shadow_color = $settings['box_shadow_color'];
4948 $padding_outer = $settings['padding_outer'];
4949 ob_start();
4950 ?>
4951 <div class="ays-accordion-data-main-wrap">
4952 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4953 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4955 <label for="ays-chart-option-width" class="form-label">
4956 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
4957 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container, in percents.","chart-builder") ); ?>">
4958 <i class="ays_fa ays_fa_info_circle"></i>
4959 </a>
4960 </label>
4961 </div>
4962 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4963 <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) ?>">
4964 <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]">
4965 <?php
4966 foreach ( $width_format_options as $option_slug => $option ):
4967 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
4968 ?>
4969 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4970 <?php
4971 endforeach;
4972 ?>
4973 </select>
4974 </div>
4975 </div> <!-- Width -->
4976 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4977 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4978 <label for="ays-chart-option-responsive-width" class="form-label">
4979 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
4980 <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") ); ?>">
4981 <i class="ays_fa ays_fa_info_circle"></i>
4982 </a>
4983 </label>
4984 </div>
4985 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4986 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4987 <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); ?> >
4988 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4989 </label>
4990 </div>
4991 </div> <!-- Responsive Width -->
4992 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4993 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4994 <label for="ays-chart-option-position">
4995 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4996 <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") ); ?>">
4997 <i class="ays_fa ays_fa_info_circle"></i>
4998 </a>
4999 </label>
5000 </div>
5001 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5002 <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]">
5003 <?php
5004 foreach ( $title_positions as $option_slug => $option ):
5005 $selected = ( $position == $option_slug ) ? 'selected' : '';
5006 ?>
5007 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5008 <?php
5009 endforeach;
5010 ?>
5011 </select>
5012 </div>
5013 </div> <!-- Position -->
5014 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5015 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5016 <label for="ays-chart-option-height" class="form-label">
5017 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
5018 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
5019 <i class="ays_fa ays_fa_info_circle"></i>
5020 </a>
5021 </label>
5022 </div>
5023 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5024 <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) ?>">
5025 <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]">
5026 <?php
5027 foreach ( $width_format_options as $option_slug => $option ):
5028 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
5029 ?>
5030 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5031 <?php
5032 endforeach;
5033 ?>
5034 </select>
5035 </div>
5036 </div> <!-- Height -->
5037 <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">
5038 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5039 <label for="ays-chart-option-font-size" class="form-label">
5040 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5041 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart text.","chart-builder") ); ?>">
5042 <i class="ays_fa ays_fa_info_circle"></i>
5043 </a>
5044 </label>
5045 </div>
5046 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5047 <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) ?>">
5048 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5049 </div>
5050 </div> <!-- Font size -->
5051 <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">
5052 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5053 <label for="ays-chart-option-org-chart-font-size" class="form-label">
5054 <?php echo esc_html(__( "Element size", 'chart-builder' )); ?>
5055 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The size of the chart element.","chart-builder") ); ?>">
5056 <i class="ays_fa ays_fa_info_circle"></i>
5057 </a>
5058 </label>
5059 </div>
5060 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5061 <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]">
5062 <?php
5063 foreach ( $org_chart_font_size_options as $option_slug => $option ):
5064 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
5065 ?>
5066 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_attr($option); ?></option>
5067 <?php
5068 endforeach;
5069 ?>
5070 </select>
5071 </div>
5072 </div> <!-- Font size for org type -->
5073 <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">
5074 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5075 <label for="ays-chart-option-background-color">
5076 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5077 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart container.","chart-builder") ); ?>">
5078 <i class="ays_fa ays_fa_info_circle"></i>
5079 </a>
5080 </label>
5081 </div>
5082 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5083 <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) ?>">
5084 </div>
5085 </div> <!-- Background color -->
5086 <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">
5087 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5088 <label for="ays-chart-option-transparent-background" class="form-label">
5089 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
5090 <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") ); ?>">
5091 <i class="ays_fa ays_fa_info_circle"></i>
5092 </a>
5093 </label>
5094 </div>
5095 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5096 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5097 <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); ?> >
5098 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5099 </label>
5100 </div>
5101 </div> <!-- Transparent background -->
5102 <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">
5103 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5104 <label for="ays-chart-option-border-width">
5105 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5106 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5107 <i class="ays_fa ays_fa_info_circle"></i>
5108 </a>
5109 </label>
5110 </div>
5111 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5112 <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) ?>">
5113 </div>
5114 </div> <!-- Border Width -->
5115 <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">
5116 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5117 <label for="ays-chart-option-border-color">
5118 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5119 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5120 <i class="ays_fa ays_fa_info_circle"></i>
5121 </a>
5122 </label>
5123 </div>
5124 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5125 <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) ?>">
5126 </div>
5127 </div> <!-- Border color -->
5128 <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">
5129 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5130 <label for="ays-chart-option-border-radius">
5131 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5132 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border radius of the chart container.","chart-builder") ); ?>">
5133 <i class="ays_fa ays_fa_info_circle"></i>
5134 </a>
5135 </label>
5136 </div>
5137 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5138 <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) ?>">
5139 </div>
5140 </div> <!-- Border radius -->
5141 <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">
5142 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5143 <label for="ays-chart-option-border-style">
5144 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5145 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5146 <i class="ays_fa ays_fa_info_circle"></i>
5147 </a>
5148 </label>
5149 </div>
5150 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5151 <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]">
5152 <?php
5153 foreach ( $border_styles as $option_slug => $option ):
5154 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5155 ?>
5156 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5157 <?php
5158 endforeach;
5159 ?>
5160 </select>
5161 </div>
5162 </div> <!-- Border style -->
5163 <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">
5164 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5165 <label for="ays-chart-option-box-shadow" class="form-label">
5166 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5167 <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") ); ?>">
5168 <i class="ays_fa ays_fa_info_circle"></i>
5169 </a>
5170 </label>
5171 </div>
5172 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5173 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5174 <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); ?> >
5175 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5176 </label>
5177 </div>
5178 </div> <!-- box shadow -->
5179 <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">
5180 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5181 <label for="ays-chart-option-box-shadow-color" class="form-label">
5182 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5183 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5184 <i class="ays_fa ays_fa_info_circle"></i>
5185 </a>
5186 </label>
5187 </div>
5188 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5189 <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) ?>">
5190 </div>
5191 </div> <!-- box shadow color -->
5192 <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">
5193 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5194 <label for="ays-chart-option-border-width-with-title">
5195 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5196 <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") ); ?>">
5197 <i class="ays_fa ays_fa_info_circle"></i>
5198 </a>
5199 </label>
5200 </div>
5201 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5202 <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) ?>">
5203 </div>
5204 </div> <!-- Border Width with title -->
5205 <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">
5206 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5207 <label for="ays-chart-option-border-radius-with-title">
5208 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
5209 <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") ); ?>">
5210 <i class="ays_fa ays_fa_info_circle"></i>
5211 </a>
5212 </label>
5213 </div>
5214 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5215 <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) ?>">
5216 </div>
5217 </div> <!-- Border radius with title -->
5218 <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">
5219 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5220 <label for="ays-chart-option-border-color-with-title">
5221 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
5222 <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") ); ?>">
5223 <i class="ays_fa ays_fa_info_circle"></i>
5224 </a>
5225 </label>
5226 </div>
5227 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5228 <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) ?>">
5229 </div>
5230 </div> <!-- Border color with title -->
5231 <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">
5232 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5233 <label for="ays-chart-option-border-style-with-title">
5234 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
5235 <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") ); ?>">
5236 <i class="ays_fa ays_fa_info_circle"></i>
5237 </a>
5238 </label>
5239 </div>
5240 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5241 <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]">
5242 <?php
5243 foreach ( $border_styles as $option_slug => $option ):
5244 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
5245 ?>
5246 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5247 <?php
5248 endforeach;
5249 ?>
5250 </select>
5251 </div>
5252 </div> <!-- Border style with title -->
5253 <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">
5254 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5255 <label for="ays-chart-option-padding-outer">
5256 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
5257 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
5258 <i class="ays_fa ays_fa_info_circle"></i>
5259 </a>
5260 </label>
5261 </div>
5262 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5263 <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) ?>">
5264 </div>
5265 </div> <!-- Padding outer -->
5266 </div>
5267 </div>
5268 <?php
5269 $content = ob_get_clean();
5270
5271 $title = __( 'Chart', "chart-builder" );
5272
5273 $sources['chart'] = array(
5274 'content' => $content,
5275 'title' => $title
5276 );
5277
5278 return $sources;
5279 }
5280
5281 public function settings_contents_chart_styles_settings_chartjs( $sources, $args ){
5282 $html_class_prefix = $args['html_class_prefix'];
5283 $html_name_prefix = $args['html_name_prefix'];
5284 $settings = $args['settings'];
5285 $border_width_with_title = $settings['border_width_with_title'];
5286 $border_radius_with_title = $settings['border_radius_with_title'];
5287 $border_width = $settings['border_width'];
5288 $border_radius = $settings['border_radius'];
5289 $border_color = $settings['border_color'];
5290 $background_color_chart = $settings['background_color_chart'];
5291 $border_style = $settings['border_style'];
5292 $border_styles = $settings['border_styles'];
5293 $box_shadow = $settings['box_shadow'];
5294 $box_shadow_color = $settings['box_shadow_color'];
5295 ob_start();
5296 ?>
5297 <div class="ays-accordion-data-main-wrap">
5298 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5299 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5300 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5301 <label for="ays-chart-option-border-width">
5302 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5303 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5304 <i class="ays_fa ays_fa_info_circle"></i>
5305 </a>
5306 </label>
5307 </div>
5308 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5309 <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) ?>">
5310 </div>
5311 </div> <!-- Border Width -->
5312 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5313 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5314 <label for="ays-chart-option-border-radius">
5315 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5316 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border.","chart-builder") ); ?>">
5317 <i class="ays_fa ays_fa_info_circle"></i>
5318 </a>
5319 </label>
5320 </div>
5321 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5322 <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) ?>">
5323 </div>
5324 </div> <!-- Border Radius -->
5325 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5326 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5327 <label for="ays-chart-option-border-color">
5328 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5329 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5330 <i class="ays_fa ays_fa_info_circle"></i>
5331 </a>
5332 </label>
5333 </div>
5334 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5335 <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) ?>">
5336 </div>
5337 </div> <!-- Border color -->
5338 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5339 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5340 <label for="ays-chart-option-border-style">
5341 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5342 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5343 <i class="ays_fa ays_fa_info_circle"></i>
5344 </a>
5345 </label>
5346 </div>
5347 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5348 <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]">
5349 <?php
5350 foreach ( $border_styles as $option_slug => $option ):
5351 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5352 ?>
5353 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5354 <?php
5355 endforeach;
5356 ?>
5357 </select>
5358 </div>
5359 </div> <!-- Border style -->
5360 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5361 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5362 <label for="ays-chart-option-backgorund-color">
5363 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5364 <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") ); ?>">
5365 <i class="ays_fa ays_fa_info_circle"></i>
5366 </a>
5367 </label>
5368 </div>
5369 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5370 <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) ?>">
5371 </div>
5372 </div><!-- Background color -->
5373
5374 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5375 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5376 <label for="ays-chart-option-box-shadow" class="form-label">
5377 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5378 <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") ); ?>">
5379 <i class="ays_fa ays_fa_info_circle"></i>
5380 </a>
5381 </label>
5382 </div>
5383 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5384 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5385 <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); ?> >
5386 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5387 </label>
5388 </div>
5389 </div> <!-- box shadow -->
5390 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5391 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5392 <label for="ays-chart-option-box-shadow-color" class="form-label">
5393 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5394 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5395 <i class="ays_fa ays_fa_info_circle"></i>
5396 </a>
5397 </label>
5398 </div>
5399 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5400 <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) ?>">
5401 </div>
5402 </div> <!-- box shadow color -->
5403 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5404 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5405 <label for="ays-chart-option-border-width-with-title">
5406 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5407 <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") ); ?>">
5408 <i class="ays_fa ays_fa_info_circle"></i>
5409 </a>
5410 </label>
5411 </div>
5412 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5413 <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) ?>">
5414 </div>
5415 </div> <!-- Border Width with title -->
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-border-radius-with-title">
5419 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
5420 <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") ); ?>">
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) ?>option-input">
5426 <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) ?>">
5427 </div>
5428 </div> <!-- Border radius with title -->
5429 </div>
5430 </div>
5431 <?php
5432 $content = ob_get_clean();
5433
5434 $title = __( 'Chart', "chart-builder" );
5435
5436 $sources['chart'] = array(
5437 'content' => $content,
5438 'title' => $title
5439 );
5440
5441 return $sources;
5442 }
5443
5444 public function settings_contents_chart_area_styles_settings( $sources, $args ){
5445 $html_class_prefix = $args['html_class_prefix'];
5446 $html_name_prefix = $args['html_name_prefix'];
5447 $settings = $args['settings'];
5448
5449 $chart_background_color = $settings['chart_background_color'];
5450 $chart_border_color = $settings['chart_border_color'];
5451 $chart_left_margin = $settings['chart_left_margin'];
5452 $chart_right_margin = $settings['chart_right_margin'];
5453 $chart_top_margin = $settings['chart_top_margin'];
5454 $chart_bottom_margin = $settings['chart_bottom_margin'];
5455 $chart_border_width = $settings['chart_border_width'];
5456 ob_start();
5457 ?>
5458 <div class="ays-accordion-data-main-wrap">
5459 <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">
5460 <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">
5461 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5462 <label for="ays-chart-option-chart-background-color">
5463 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5464 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart area.","chart-builder") ); ?>">
5465 <i class="ays_fa ays_fa_info_circle"></i>
5466 </a>
5467 </label>
5468 </div>
5469 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5470 <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) ?>">
5471 </div>
5472 </div> <!-- Chart Area background color -->
5473 <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">
5474 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5475 <label for="ays-chart-option-chart-border-width">
5476 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5477 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border width of the chart area.","chart-builder") ); ?>">
5478 <i class="ays_fa ays_fa_info_circle"></i>
5479 </a>
5480 </label>
5481 </div>
5482 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5483 <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) ?>">
5484 </div>
5485 </div> <!-- Chart Area Border Width -->
5486 <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">
5487 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5488 <label for="ays-chart-option-chart-border-color">
5489 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5490 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart area.","chart-builder") ); ?>">
5491 <i class="ays_fa ays_fa_info_circle"></i>
5492 </a>
5493 </label>
5494 </div>
5495 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5496 <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) ?>">
5497 </div>
5498 </div> <!-- Chart Area border color -->
5499 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5500 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5501 <label for="ays-chart-option-chart-left-margin">
5502 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
5503 <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") ); ?>">
5504 <i class="ays_fa ays_fa_info_circle"></i>
5505 </a>
5506 </label>
5507 </div>
5508 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5509 <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) ?>">
5510 </div>
5511 </div> <!-- Chart Area Left Margin -->
5512 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5513 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5514 <label for="ays-chart-option-chart-right-margin">
5515 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
5516 <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") ); ?>">
5517 <i class="ays_fa ays_fa_info_circle"></i>
5518 </a>
5519 </label>
5520 </div>
5521 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5522 <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) ?>">
5523 </div>
5524 </div> <!-- Chart Area Right Margin -->
5525 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5526 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5527 <label for="ays-chart-option-chart-top-margin">
5528 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
5529 <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") ); ?>">
5530 <i class="ays_fa ays_fa_info_circle"></i>
5531 </a>
5532 </label>
5533 </div>
5534 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5535 <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) ?>">
5536 </div>
5537 </div> <!-- Chart Area Top Margin -->
5538 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5539 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5540 <label for="ays-chart-option-chart-bottom-margin">
5541 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
5542 <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") ); ?>">
5543 <i class="ays_fa ays_fa_info_circle"></i>
5544 </a>
5545 </label>
5546 </div>
5547 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5548 <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) ?>">
5549 </div>
5550 </div> <!-- Chart Area Bottom Margin -->
5551 </div>
5552 </div>
5553 <?php
5554 $content = ob_get_clean();
5555
5556 $title = __( 'Chart Area', "chart-builder" );
5557
5558 $sources['chart_area'] = array(
5559 'content' => $content,
5560 'title' => $title
5561 );
5562
5563 return $sources;
5564 }
5565
5566 public function settings_contents_title_styles_settings( $sources, $args ){
5567 $html_class_prefix = $args['html_class_prefix'];
5568 $html_name_prefix = $args['html_name_prefix'];
5569 $settings = $args['settings'];
5570
5571 $title_color = $settings['title_color'];
5572 $title_shadow_color = $settings['title_shadow_color'];
5573 $title_font_size = $settings['title_font_size'];
5574 $title_gap = $settings['title_gap'];
5575 $title_gap_description = $settings['title_gap_description'];
5576 $title_positions = $settings['title_positions'];
5577 $title_position = $settings['title_position'];
5578 $title_bold = $settings['title_bold'];
5579 $title_text_shadow = $settings['title_text_shadow'];
5580 $title_italic = $settings['title_italic'];
5581 $text_transforms = $settings['text_transforms'];
5582 $text_decorations = $settings['text_decorations'];
5583 $title_text_transform = $settings['title_text_transform'];
5584 $title_text_decoration = $settings['title_text_decoration'];
5585 $title_letter_spacing = $settings['title_letter_spacing'];
5586 ob_start();
5587 ?>
5588 <div class="ays-accordion-data-main-wrap">
5589 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5590 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5591 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5592 <label for="ays-chart-option-title-color">
5593 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5594 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5595 <i class="ays_fa ays_fa_info_circle"></i>
5596 </a>
5597 </label>
5598 </div>
5599 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5600 <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) ?>">
5601 </div>
5602 </div> <!-- Chart title color -->
5603 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5604 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5605 <label for="ays-chart-option-title-font-size" class="form-label">
5606 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5607 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5608 <i class="ays_fa ays_fa_info_circle"></i>
5609 </a>
5610 </label>
5611 </div>
5612 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5613 <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) ?>">
5614 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5615 </div>
5616 </div> <!-- Chart title font size -->
5617 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5618 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5619 <label for="ays-chart-option-title-bold" class="form-label">
5620 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5621 <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") ); ?>">
5622 <i class="ays_fa ays_fa_info_circle"></i>
5623 </a>
5624 </label>
5625 </div>
5626 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5627 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5628 <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); ?> >
5629 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5630 </label>
5631 </div>
5632 </div> <!-- Title bold -->
5633 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5634 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5635 <label for="ays-chart-option-title-italic" class="form-label">
5636 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5637 <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") ); ?>">
5638 <i class="ays_fa ays_fa_info_circle"></i>
5639 </a>
5640 </label>
5641 </div>
5642 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5643 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5644 <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); ?> >
5645 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5646 </label>
5647 </div>
5648 </div> <!-- Title italic -->
5649 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5650 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5651 <label for="ays-chart-option-title-position">
5652 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5653 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5654 <i class="ays_fa ays_fa_info_circle"></i>
5655 </a>
5656 </label>
5657 </div>
5658 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5659 <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]">
5660 <?php
5661 foreach ( $title_positions as $option_slug => $option ):
5662 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5663 ?>
5664 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5665 <?php
5666 endforeach;
5667 ?>
5668 </select>
5669 </div>
5670 </div> <!-- Title position -->
5671 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5672 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5673 <label for="ays-chart-option-title-gap" class="form-label">
5674 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5675 <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") ); ?>">
5676 <i class="ays_fa ays_fa_info_circle"></i>
5677 </a>
5678 </label>
5679 </div>
5680 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5681 <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) ?>">
5682 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5683 </div>
5684 </div> <!-- Chart title gap -->
5685 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5686 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5687 <label for="ays-chart-option-title-gap-description" class="form-label">
5688 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5689 <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") ); ?>">
5690 <i class="ays_fa ays_fa_info_circle"></i>
5691 </a>
5692 </label>
5693 </div>
5694 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5695 <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) ?>">
5696 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5697 </div>
5698 </div> <!-- Chart title gap -->
5699 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5700 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5701 <label for="ays-chart-option-title-text-transform">
5702 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5703 <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") ); ?>">
5704 <i class="ays_fa ays_fa_info_circle"></i>
5705 </a>
5706 </label>
5707 </div>
5708 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5709 <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]">
5710 <?php
5711 foreach ( $text_transforms as $option_slug => $option ):
5712 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5713 ?>
5714 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5715 <?php
5716 endforeach;
5717 ?>
5718 </select>
5719 </div>
5720 </div> <!-- Title text transform -->
5721 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5722 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5723 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5724 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5725 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5726 <i class="ays_fa ays_fa_info_circle"></i>
5727 </a>
5728 </label>
5729 </div>
5730 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5731 <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) ?>">
5732 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5733 </div>
5734 </div> <!-- Chart title letter spacing -->
5735 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5736 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5737 <label for="ays-chart-option-title-text-decoration">
5738 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5739 <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") ); ?>">
5740 <i class="ays_fa ays_fa_info_circle"></i>
5741 </a>
5742 </label>
5743 </div>
5744 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5745 <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]">
5746 <?php
5747 foreach ( $text_decorations as $option_slug => $option ):
5748 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5749 ?>
5750 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5751 <?php
5752 endforeach;
5753 ?>
5754 </select>
5755 </div>
5756 </div> <!-- Title text decoration -->
5757 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5758 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5759 <label for="ays-chart-option-title-text-shadow" class="form-label">
5760 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5761 <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") ); ?>">
5762 <i class="ays_fa ays_fa_info_circle"></i>
5763 </a>
5764 </label>
5765 </div>
5766 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5767 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5768 <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); ?> >
5769 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5770 </label>
5771 </div>
5772 </div> <!-- Title bold -->
5773 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5774 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5775 <label for="ays-chart-option-title-shadow-color">
5776 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5777 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5778 <i class="ays_fa ays_fa_info_circle"></i>
5779 </a>
5780 </label>
5781 </div>
5782 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5783 <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) ?>">
5784 </div>
5785 </div> <!-- Chart title color -->
5786 </div>
5787 </div>
5788 <?php
5789 $content = ob_get_clean();
5790
5791 $title = __( 'Title', "chart-builder" );
5792
5793 $sources['title'] = array(
5794 'content' => $content,
5795 'title' => $title
5796 );
5797
5798 return $sources;
5799 }
5800
5801 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5802 $html_class_prefix = $args['html_class_prefix'];
5803 $html_name_prefix = $args['html_name_prefix'];
5804 $settings = $args['settings'];
5805
5806 $title_color = $settings['title_color'];
5807 $title_shadow_color = $settings['title_shadow_color'];
5808 $title_font_size = $settings['title_font_size'];
5809 $title_gap = $settings['title_gap'];
5810 $title_gap_description = $settings['title_gap_description'];
5811 $title_positions = $settings['title_positions'];
5812 $title_position = $settings['title_position'];
5813 $title_bold = $settings['title_bold'];
5814 $title_text_shadow = $settings['title_text_shadow'];
5815 $title_italic = $settings['title_italic'];
5816 $text_transforms = $settings['text_transforms'];
5817 $text_decorations = $settings['text_decorations'];
5818 $title_text_transform = $settings['title_text_transform'];
5819 $title_text_decoration = $settings['title_text_decoration'];
5820 $title_letter_spacing = $settings['title_letter_spacing'];
5821 ob_start();
5822 ?>
5823 <div class="ays-accordion-data-main-wrap">
5824 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5825 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5826 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5827 <label for="ays-chart-option-title-color">
5828 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5829 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5830 <i class="ays_fa ays_fa_info_circle"></i>
5831 </a>
5832 </label>
5833 </div>
5834 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5835 <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) ?>">
5836 </div>
5837 </div> <!-- Chart title color -->
5838 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5839 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5840 <label for="ays-chart-option-title-font-size" class="form-label">
5841 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5842 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5843 <i class="ays_fa ays_fa_info_circle"></i>
5844 </a>
5845 </label>
5846 </div>
5847 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5848 <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) ?>">
5849 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5850 </div>
5851 </div> <!-- Chart title font size -->
5852 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5853 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5854 <label for="ays-chart-option-title-bold" class="form-label">
5855 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5856 <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") ); ?>">
5857 <i class="ays_fa ays_fa_info_circle"></i>
5858 </a>
5859 </label>
5860 </div>
5861 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5862 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5863 <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); ?> >
5864 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5865 </label>
5866 </div>
5867 </div> <!-- Title bold -->
5868 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5869 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5870 <label for="ays-chart-option-title-italic" class="form-label">
5871 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5872 <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") ); ?>">
5873 <i class="ays_fa ays_fa_info_circle"></i>
5874 </a>
5875 </label>
5876 </div>
5877 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5878 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5879 <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); ?> >
5880 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5881 </label>
5882 </div>
5883 </div> <!-- Title italic -->
5884 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5885 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5886 <label for="ays-chart-option-title-position">
5887 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5888 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5889 <i class="ays_fa ays_fa_info_circle"></i>
5890 </a>
5891 </label>
5892 </div>
5893 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5894 <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]">
5895 <?php
5896 foreach ( $title_positions as $option_slug => $option ):
5897 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5898 ?>
5899 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5900 <?php
5901 endforeach;
5902 ?>
5903 </select>
5904 </div>
5905 </div> <!-- Title position -->
5906 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5907 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5908 <label for="ays-chart-option-title-gap" class="form-label">
5909 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5910 <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") ); ?>">
5911 <i class="ays_fa ays_fa_info_circle"></i>
5912 </a>
5913 </label>
5914 </div>
5915 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5916 <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) ?>">
5917 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5918 </div>
5919 </div> <!-- Chart title gap -->
5920 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5921 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5922 <label for="ays-chart-option-title-gap-description" class="form-label">
5923 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5924 <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") ); ?>">
5925 <i class="ays_fa ays_fa_info_circle"></i>
5926 </a>
5927 </label>
5928 </div>
5929 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5930 <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) ?>">
5931 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5932 </div>
5933 </div> <!-- Chart title gap -->
5934 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5935 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5936 <label for="ays-chart-option-title-text-transform">
5937 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5938 <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") ); ?>">
5939 <i class="ays_fa ays_fa_info_circle"></i>
5940 </a>
5941 </label>
5942 </div>
5943 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5944 <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]">
5945 <?php
5946 foreach ( $text_transforms as $option_slug => $option ):
5947 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5948 ?>
5949 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5950 <?php
5951 endforeach;
5952 ?>
5953 </select>
5954 </div>
5955 </div> <!-- Title text transform -->
5956 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5957 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5958 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5959 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5960 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5961 <i class="ays_fa ays_fa_info_circle"></i>
5962 </a>
5963 </label>
5964 </div>
5965 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5966 <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) ?>">
5967 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5968 </div>
5969 </div> <!-- Chart title letter spacing -->
5970 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5971 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5972 <label for="ays-chart-option-title-text-decoration">
5973 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5974 <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") ); ?>">
5975 <i class="ays_fa ays_fa_info_circle"></i>
5976 </a>
5977 </label>
5978 </div>
5979 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5980 <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]">
5981 <?php
5982 foreach ( $text_decorations as $option_slug => $option ):
5983 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5984 ?>
5985 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5986 <?php
5987 endforeach;
5988 ?>
5989 </select>
5990 </div>
5991 </div> <!-- Title text decoration -->
5992 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5993 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5994 <label for="ays-chart-option-title-text-shadow" class="form-label">
5995 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5996 <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") ); ?>">
5997 <i class="ays_fa ays_fa_info_circle"></i>
5998 </a>
5999 </label>
6000 </div>
6001 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6002 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6003 <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); ?> >
6004 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6005 </label>
6006 </div>
6007 </div> <!-- Title bold -->
6008 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6009 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6010 <label for="ays-chart-option-title-shadow-color">
6011 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6012 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
6013 <i class="ays_fa ays_fa_info_circle"></i>
6014 </a>
6015 </label>
6016 </div>
6017 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6018 <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) ?>">
6019 </div>
6020 </div> <!-- Chart title color -->
6021 </div>
6022 </div>
6023 <?php
6024 $content = ob_get_clean();
6025
6026 $title = __( 'Title', "chart-builder" );
6027
6028 $sources['title'] = array(
6029 'content' => $content,
6030 'title' => $title
6031 );
6032
6033 return $sources;
6034 }
6035
6036 public function settings_contents_description_styles_settings( $sources, $args ){
6037 $html_class_prefix = $args['html_class_prefix'];
6038 $html_name_prefix = $args['html_name_prefix'];
6039 $settings = $args['settings'];
6040
6041 $description_color = $settings['description_color'];
6042 $description_font_size = $settings['description_font_size'];
6043 $title_positions = $settings['title_positions'];
6044 $description_position = $settings['description_position'];
6045 $description_bold = $settings['description_bold'];
6046 $description_text_shadow = $settings['description_text_shadow'];
6047 $description_shadow_color = $settings['description_shadow_color'];
6048 $description_italic = $settings['description_italic'];
6049 $text_transforms = $settings['text_transforms'];
6050 $text_decorations = $settings['text_decorations'];
6051 $description_text_transform = $settings['description_text_transform'];
6052 $description_text_decoration = $settings['description_text_decoration'];
6053 $description_letter_spacing = $settings['description_letter_spacing'];
6054
6055 ob_start();
6056 ?>
6057 <div class="ays-accordion-data-main-wrap">
6058 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6059 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6060 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6061 <label for="ays-chart-option-description-color">
6062 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6063 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6064 <i class="ays_fa ays_fa_info_circle"></i>
6065 </a>
6066 </label>
6067 </div>
6068 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6069 <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) ?>">
6070 </div>
6071 </div> <!-- Chart description color -->
6072 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6073 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6074 <label for="ays-chart-option-description-font-size" class="form-label">
6075 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6076 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6077 <i class="ays_fa ays_fa_info_circle"></i>
6078 </a>
6079 </label>
6080 </div>
6081 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6082 <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) ?>">
6083 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6084 </div>
6085 </div> <!-- Chart description font size -->
6086 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6087 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6088 <label for="ays-chart-option-description-bold" class="form-label">
6089 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6090 <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") ); ?>">
6091 <i class="ays_fa ays_fa_info_circle"></i>
6092 </a>
6093 </label>
6094 </div>
6095 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6096 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6097 <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); ?> >
6098 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6099 </label>
6100 </div>
6101 </div> <!-- Description bold -->
6102 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6103 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6104 <label for="ays-chart-option-description-italic" class="form-label">
6105 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6106 <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") ); ?>">
6107 <i class="ays_fa ays_fa_info_circle"></i>
6108 </a>
6109 </label>
6110 </div>
6111 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6112 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6113 <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); ?> >
6114 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6115 </label>
6116 </div>
6117 </div> <!-- Description italic -->
6118 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6119 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6120 <label for="ays-chart-option-description-position">
6121 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6122 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6123 <i class="ays_fa ays_fa_info_circle"></i>
6124 </a>
6125 </label>
6126 </div>
6127 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6128 <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]">
6129 <?php
6130 foreach ( $title_positions as $option_slug => $option ):
6131 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6132 ?>
6133 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6134 <?php
6135 endforeach;
6136 ?>
6137 </select>
6138 </div>
6139 </div> <!-- Description position -->
6140 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6141 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6142 <label for="ays-chart-option-description-text-transform">
6143 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6144 <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") ); ?>">
6145 <i class="ays_fa ays_fa_info_circle"></i>
6146 </a>
6147 </label>
6148 </div>
6149 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6150 <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]">
6151 <?php
6152 foreach ( $text_transforms as $option_slug => $option ):
6153 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6154 ?>
6155 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6156 <?php
6157 endforeach;
6158 ?>
6159 </select>
6160 </div>
6161 </div> <!-- description text transform -->
6162 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6163 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6164 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6165 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6166 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6167 <i class="ays_fa ays_fa_info_circle"></i>
6168 </a>
6169 </label>
6170 </div>
6171 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6172 <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) ?>">
6173 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6174 </div>
6175 </div> <!-- Chart description letter spacing -->
6176 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6177 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6178 <label for="ays-chart-option-description-text-decoration">
6179 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6180 <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") ); ?>">
6181 <i class="ays_fa ays_fa_info_circle"></i>
6182 </a>
6183 </label>
6184 </div>
6185 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6186 <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]">
6187 <?php
6188 foreach ( $text_decorations as $option_slug => $option ):
6189 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6190 ?>
6191 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6192 <?php
6193 endforeach;
6194 ?>
6195 </select>
6196 </div>
6197 </div> <!-- description text decoration -->
6198 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6199 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6200 <label for="ays-chart-option-description-text-shadow" class="form-label">
6201 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6202 <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") ); ?>">
6203 <i class="ays_fa ays_fa_info_circle"></i>
6204 </a>
6205 </label>
6206 </div>
6207 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6208 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6209 <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); ?> >
6210 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6211 </label>
6212 </div>
6213 </div> <!-- description bold -->
6214 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6215 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6216 <label for="ays-chart-option-description-shadow-color">
6217 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6218 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6219 <i class="ays_fa ays_fa_info_circle"></i>
6220 </a>
6221 </label>
6222 </div>
6223 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6224 <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) ?>">
6225 </div>
6226 </div> <!-- Chart title color -->
6227 </div>
6228 </div>
6229 <?php
6230 $content = ob_get_clean();
6231
6232 $title = __( 'Description', "chart-builder" );
6233
6234 $sources['description'] = array(
6235 'content' => $content,
6236 'title' => $title
6237 );
6238
6239 return $sources;
6240 }
6241
6242 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
6243 $html_class_prefix = $args['html_class_prefix'];
6244 $html_name_prefix = $args['html_name_prefix'];
6245 $settings = $args['settings'];
6246
6247 $description_color = $settings['description_color'];
6248 $description_font_size = $settings['description_font_size'];
6249 $title_positions = $settings['title_positions'];
6250 $description_position = $settings['description_position'];
6251 $description_bold = $settings['description_bold'];
6252 $description_text_shadow = $settings['description_text_shadow'];
6253 $description_shadow_color = $settings['description_shadow_color'];
6254 $description_italic = $settings['description_italic'];
6255 $text_transforms = $settings['text_transforms'];
6256 $text_decorations = $settings['text_decorations'];
6257 $description_text_transform = $settings['description_text_transform'];
6258 $description_text_decoration = $settings['description_text_decoration'];
6259 $description_letter_spacing = $settings['description_letter_spacing'];
6260
6261 ob_start();
6262 ?>
6263 <div class="ays-accordion-data-main-wrap">
6264 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6265 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6266 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6267 <label for="ays-chart-option-description-color">
6268 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6269 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6270 <i class="ays_fa ays_fa_info_circle"></i>
6271 </a>
6272 </label>
6273 </div>
6274 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6275 <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) ?>">
6276 </div>
6277 </div> <!-- Chart description color -->
6278 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6279 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6280 <label for="ays-chart-option-description-font-size" class="form-label">
6281 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6282 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6283 <i class="ays_fa ays_fa_info_circle"></i>
6284 </a>
6285 </label>
6286 </div>
6287 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6288 <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) ?>">
6289 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6290 </div>
6291 </div> <!-- Chart description font size -->
6292 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6293 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6294 <label for="ays-chart-option-description-bold" class="form-label">
6295 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6296 <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") ); ?>">
6297 <i class="ays_fa ays_fa_info_circle"></i>
6298 </a>
6299 </label>
6300 </div>
6301 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6302 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6303 <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); ?> >
6304 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6305 </label>
6306 </div>
6307 </div> <!-- Description bold -->
6308 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6309 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6310 <label for="ays-chart-option-description-italic" class="form-label">
6311 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6312 <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") ); ?>">
6313 <i class="ays_fa ays_fa_info_circle"></i>
6314 </a>
6315 </label>
6316 </div>
6317 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6318 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6319 <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); ?> >
6320 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6321 </label>
6322 </div>
6323 </div> <!-- Description italic -->
6324 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6325 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6326 <label for="ays-chart-option-description-position">
6327 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6328 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6329 <i class="ays_fa ays_fa_info_circle"></i>
6330 </a>
6331 </label>
6332 </div>
6333 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6334 <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]">
6335 <?php
6336 foreach ( $title_positions as $option_slug => $option ):
6337 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6338 ?>
6339 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6340 <?php
6341 endforeach;
6342 ?>
6343 </select>
6344 </div>
6345 </div> <!-- Description position -->
6346 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6347 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6348 <label for="ays-chart-option-description-text-transform">
6349 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6350 <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") ); ?>">
6351 <i class="ays_fa ays_fa_info_circle"></i>
6352 </a>
6353 </label>
6354 </div>
6355 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6356 <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]">
6357 <?php
6358 foreach ( $text_transforms as $option_slug => $option ):
6359 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6360 ?>
6361 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6362 <?php
6363 endforeach;
6364 ?>
6365 </select>
6366 </div>
6367 </div> <!-- description text transform -->
6368 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6369 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6370 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6371 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6372 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6373 <i class="ays_fa ays_fa_info_circle"></i>
6374 </a>
6375 </label>
6376 </div>
6377 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6378 <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) ?>">
6379 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6380 </div>
6381 </div> <!-- Chart description letter spacing -->
6382 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6383 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6384 <label for="ays-chart-option-description-text-decoration">
6385 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6386 <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") ); ?>">
6387 <i class="ays_fa ays_fa_info_circle"></i>
6388 </a>
6389 </label>
6390 </div>
6391 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6392 <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]">
6393 <?php
6394 foreach ( $text_decorations as $option_slug => $option ):
6395 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6396 ?>
6397 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6398 <?php
6399 endforeach;
6400 ?>
6401 </select>
6402 </div>
6403 </div> <!-- description text decoration -->
6404 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6405 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6406 <label for="ays-chart-option-description-text-shadow" class="form-label">
6407 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6408 <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") ); ?>">
6409 <i class="ays_fa ays_fa_info_circle"></i>
6410 </a>
6411 </label>
6412 </div>
6413 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6414 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6415 <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); ?> >
6416 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6417 </label>
6418 </div>
6419 </div> <!-- description bold -->
6420 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6421 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6422 <label for="ays-chart-option-description-shadow-color">
6423 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6424 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6425 <i class="ays_fa ays_fa_info_circle"></i>
6426 </a>
6427 </label>
6428 </div>
6429 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6430 <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) ?>">
6431 </div>
6432 </div> <!-- Chart title color -->
6433 </div>
6434 </div>
6435 <?php
6436 $content = ob_get_clean();
6437
6438 $title = __( 'Description', "chart-builder" );
6439
6440 $sources['description'] = array(
6441 'content' => $content,
6442 'title' => $title
6443 );
6444
6445 return $sources;
6446 }
6447
6448 /**
6449 * Chart page settings contents
6450 * @param $args
6451 */
6452 public function ays_chart_page_advanced_settings_contents( $args ){
6453 $chart_source_type = $args['chart_source_type'];
6454
6455 if ($chart_source_type === 'chart-js') {
6456 if ($args['source_chart_type'] !== 'pie_chart') {return;}
6457 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
6458 } else {
6459 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
6460 }
6461
6462 $sources = array();
6463 foreach ( $sources_contents as $key => $sources_content ) {
6464 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
6465
6466 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
6467 if(isset($sources_content['title'])){
6468 $content .= '<legend class="ays-accordion-options-header">';
6469 $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">
6470 <g>
6471 <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" />
6472 </g>
6473 </svg>';
6474
6475 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
6476 }
6477
6478 $content .= '<div class="ays-accordion-options-content">';
6479 $content .= $sources_content['content'];
6480 $content .= '</div>';
6481
6482 $content .= '</fieldset>';
6483
6484 $sources[] = $content;
6485 }
6486 $content_for_escape = implode('' , $sources );
6487 echo html_entity_decode( esc_html($content_for_escape) );
6488 }
6489
6490 public function settings_contents_advanced_settings( $sources, $args ){
6491 $html_class_prefix = $args['html_class_prefix'];
6492 $html_name_prefix = $args['html_name_prefix'];
6493 $settings = $args['settings'];
6494 $tab_title = $args['tab_name'];
6495
6496 $rotation_degree = $settings['rotation_degree'];
6497 $reverse_categories = $settings['reverse_categories'];
6498 $slice_border_color = $settings['slice_border_color'];
6499 $slice_texts = $settings['slice_texts'];
6500 $slice_text = $settings['slice_text'];
6501 $tooltip_text_options = $settings['tooltip_text_options'];
6502 $tooltip_text = $settings['tooltip_text'];
6503 $is_stacked = $settings['is_stacked'];
6504 $focus_target_options = $settings['focus_target_options'];
6505 $focus_target = $settings['focus_target'];
6506 $multiple_data_format_options = $settings['multiple_data_format_options'];
6507 $multiple_data_format = $settings['multiple_data_format'];
6508 $opacity = $settings['opacity'];
6509 $group_width = $settings['group_width'];
6510 $group_width_format = $settings['group_width_format'];
6511 $group_width_format_options = $settings['group_width_format_options'];
6512 $line_width = $settings['line_width'];
6513 $data_grouping_limit = $settings['data_grouping_limit'];
6514 $data_grouping_label = $settings['data_grouping_label'];
6515 $data_grouping_color = $settings['data_grouping_color'];
6516 $multiple_selection = $settings['multiple_selection'];
6517 $point_shape_options = $settings['point_shape_options'];
6518 $point_shape = $settings['point_shape'];
6519 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
6520 $crosshair_trigger = $settings['crosshair_trigger'];
6521 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
6522 $crosshair_orientation = $settings['crosshair_orientation'];
6523 $crosshair_opacity = $settings['crosshair_opacity'];
6524 $dash_style = $settings['dash_style'];
6525 $point_size = $settings['point_size'];
6526 $donut_hole_size = $settings['donut_hole_size'];
6527 $orientation = $settings['orientation'];
6528 $fill_nulls = $settings['fill_nulls'];
6529 $allow_collapse = $settings['allow_collapse'];
6530 $org_classname = $settings['org_classname'];
6531 $org_node_background_color = $settings['org_node_background_color'];
6532 $org_node_padding = $settings['org_node_padding'];
6533 $org_node_border_radius = $settings['org_node_border_radius'];
6534 $org_node_border_width = $settings['org_node_border_width'];
6535 $org_node_border_color = $settings['org_node_border_color'];
6536 $org_node_text_color = $settings['org_node_text_color'];
6537 $org_node_text_font_size = $settings['org_node_text_font_size'];
6538 $org_node_description_font_color = $settings['org_node_description_font_color'];
6539 $org_node_description_font_size = $settings['org_node_description_font_size'];
6540 $org_selected_classname = $settings['org_selected_classname'];
6541 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
6542 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
6543
6544 ob_start();
6545 ?>
6546 <div class="ays-accordion-data-main-wrap">
6547 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6548 <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">
6549 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6550 <label for="ays-chart-option-rotation-degree" class="form-label">
6551 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
6552 <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") ); ?>">
6553 <i class="ays_fa ays_fa_info_circle"></i>
6554 </a>
6555 </label>
6556 </div>
6557 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6558 <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) ?>">
6559 </div>
6560 </div> <!-- Rotation degree -->
6561 <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">
6562 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6563 <label for="ays-chart-option-reverse-categories">
6564 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
6565 <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") ); ?>">
6566 <i class="ays_fa ays_fa_info_circle"></i>
6567 </a>
6568 </label>
6569 </div>
6570 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6571 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6572 <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); ?> >
6573 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6574 </label>
6575 </div>
6576 </div> <!-- Reverse Categories -->
6577 <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">
6578 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6579 <label for="ays-chart-option-slice-border-color">
6580 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
6581 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
6582 <i class="ays_fa ays_fa_info_circle"></i>
6583 </a>
6584 </label>
6585 </div>
6586 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6587 <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) ?>">
6588 </div>
6589 </div> <!-- Slice border color -->
6590 <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">
6591 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6592 <label for="ays-chart-option-slice-text">
6593 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6594 <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") ); ?>">
6595 <i class="ays_fa ays_fa_info_circle"></i>
6596 </a>
6597 </label>
6598 </div>
6599 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6600 <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]">
6601 <?php
6602 foreach ( $slice_texts as $option_slug => $option ):
6603 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6604 ?>
6605 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6606 <?php
6607 endforeach;
6608 ?>
6609 </select>
6610 </div>
6611 </div> <!-- Slice text -->
6612 <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">
6613 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6614 <label for="ays-chart-option-tooltip-text">
6615 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6616 <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") ); ?>">
6617 <i class="ays_fa ays_fa_info_circle"></i>
6618 </a>
6619 </label>
6620 </div>
6621 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6622 <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]">
6623 <?php
6624 foreach ( $tooltip_text_options as $option_slug => $option ):
6625 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6626 ?>
6627 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6628 <?php
6629 endforeach;
6630 ?>
6631 </select>
6632 </div>
6633 </div> <!-- Slice tooltip Text -->
6634 <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">
6635 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6636 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6637 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6638 <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") ); ?>">
6639 <i class="ays_fa ays_fa_info_circle"></i>
6640 </a>
6641 </label>
6642 </div>
6643 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6644 <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">
6645 </div>
6646 </div> <!-- Data Grouping Limit -->
6647 <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">
6648 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6649 <label for="ays-chart-option-data-grouping-label" class="form-label">
6650 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6651 <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") ); ?>">
6652 <i class="ays_fa ays_fa_info_circle"></i>
6653 </a>
6654 </label>
6655 </div>
6656 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6657 <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) ?>">
6658 </div>
6659 </div> <!-- Data Grouping Label -->
6660 <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">
6661 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6662 <label for="ays-chart-option-data-grouping-color">
6663 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6664 <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") ); ?>">
6665 <i class="ays_fa ays_fa_info_circle"></i>
6666 </a>
6667 </label>
6668 </div>
6669 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6670 <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) ?>">
6671 </div>
6672 </div> <!-- Data Grouping Color -->
6673 <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">
6674 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6675 <label for="ays-chart-option-is-stacked">
6676 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6677 <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") ); ?>">
6678 <i class="ays_fa ays_fa_info_circle"></i>
6679 </a>
6680 </label>
6681 </div>
6682 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6683 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6684 <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); ?> >
6685 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6686 </label>
6687 </div>
6688 </div> <!-- Is stacked -->
6689 <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">
6690 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6691 <label for="ays-chart-option-focus-target">
6692 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6693 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6694 echo esc_html( sprintf(
6695 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6696 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6697 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6698 __('%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>" .
6699 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6700 __('%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>",
6701 '<em>', '</em>',
6702 '<em>', '</em>'
6703 ));
6704 ?>">
6705 <i class="ays_fa ays_fa_info_circle"></i>
6706 </a>
6707 </label>
6708 </div>
6709 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6710 <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]">
6711 <?php
6712 foreach ( $focus_target_options as $option_slug => $option ):
6713 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6714 ?>
6715 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6716 <?php
6717 endforeach;
6718 ?>
6719 </select>
6720 </div>
6721 </div> <!-- Focus target -->
6722 <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">
6723 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6724 <label for="ays-chart-option-opacity" class="form-label">
6725 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6726 <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") ); ?>">
6727 <i class="ays_fa ays_fa_info_circle"></i>
6728 </a>
6729 </label>
6730 </div>
6731 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6732 <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">
6733 </div>
6734 </div> <!-- Data opacity -->
6735 <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">
6736 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6737 <label for="ays-chart-option-group-width">
6738 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6739 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6740 echo esc_html( sprintf(
6741 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6742 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6743 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6744 __('%1$sPixels:%2$s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6745 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6746 __('%1$sPercentage:%2$s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6747 '<em>', '</em>',
6748 '<em>', '</em>'
6749 ));
6750 ?>">
6751 <i class="ays_fa ays_fa_info_circle"></i>
6752 </a>
6753 </label>
6754 </div>
6755 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6756 <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) ?>">
6757 <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]">
6758 <?php
6759 foreach ( $group_width_format_options as $option_slug => $option ):
6760 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6761 ?>
6762 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6763 <?php
6764 endforeach;
6765 ?>
6766 </select>
6767 </div>
6768 </div> <!-- Bars width -->
6769 <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">
6770 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6771 <label for="ays-chart-option-line-width" class="form-label">
6772 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6773 <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") ); ?>">
6774 <i class="ays_fa ays_fa_info_circle"></i>
6775 </a>
6776 </label>
6777 </div>
6778 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6779 <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) ?>">
6780 </div>
6781 </div> <!-- Line width -->
6782 <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">
6783 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6784 <label for="ays-chart-option-multiple-selection">
6785 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6786 <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") ); ?>">
6787 <i class="ays_fa ays_fa_info_circle"></i>
6788 </a>
6789 </label>
6790 </div>
6791 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6792 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6793 <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); ?> >
6794 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6795 </label>
6796 </div>
6797 </div> <!-- Multiple data selection -->
6798 <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">
6799 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6800 <label for="ays-chart-option-multiple-data-format">
6801 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6802 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6803 echo esc_html( sprintf(
6804 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6805 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6806 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6807 __('%1$sCategory:%2$s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6808 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6809 __('%1$sSeries:%2$s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6810 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6811 __('%1$sAuto:%2$s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6812 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6813 __('%1$sNone:%2$s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6814 '<em>', '</em>',
6815 '<em>', '</em>',
6816 '<em>', '</em>',
6817 '<em>', '</em>'
6818 ));
6819 ?>">
6820 <i class="ays_fa ays_fa_info_circle"></i>
6821 </a>
6822 </label>
6823 </div>
6824 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6825 <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]">
6826 <?php
6827 foreach ( $multiple_data_format_options as $option_slug => $option ):
6828 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6829 ?>
6830 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6831 <?php
6832 endforeach;
6833 ?>
6834 </select>
6835 </div>
6836 </div> <!-- Multiple data format -->
6837 <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">
6838 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6839 <label for="ays-chart-option-point-shape">
6840 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6841 <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") ); ?>">
6842 <i class="ays_fa ays_fa_info_circle"></i>
6843 </a>
6844 </label>
6845 </div>
6846 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6847 <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]">
6848 <?php
6849 foreach ( $point_shape_options as $option_slug => $option ):
6850 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6851 ?>
6852 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6853 <?php
6854 endforeach;
6855 ?>
6856 </select>
6857 </div>
6858 </div> <!-- Point shape -->
6859 <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">
6860 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6861 <label for="ays-chart-option-point-size" class="form-label">
6862 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6863 <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") ); ?>">
6864 <i class="ays_fa ays_fa_info_circle"></i>
6865 </a>
6866 </label>
6867 </div>
6868 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6869 <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) ?>">
6870 </div>
6871 </div> <!-- Point size -->
6872 <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">
6873 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6874 <label for="ays-chart-option-orientation">
6875 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6876 <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") ); ?>">
6877 <i class="ays_fa ays_fa_info_circle"></i>
6878 </a>
6879 </label>
6880 </div>
6881 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6882 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6883 <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); ?> >
6884 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6885 </label>
6886 </div>
6887 </div> <!-- Orientation -->
6888 <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">
6889 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6890 <label for="ays-chart-option-fill-nulls">
6891 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6892 <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") ); ?>">
6893 <i class="ays_fa ays_fa_info_circle"></i>
6894 </a>
6895 </label>
6896 </div>
6897 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6898 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6899 <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); ?> >
6900 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6901 </label>
6902 </div>
6903 </div> <!-- Autofill nulls -->
6904 <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">
6905 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6906 <label for="ays-chart-option-crosshair-trigger">
6907 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6908 <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") ); ?>">
6909 <i class="ays_fa ays_fa_info_circle"></i>
6910 </a>
6911 </label>
6912 </div>
6913 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6914 <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]">
6915 <?php
6916 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6917 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6918 ?>
6919 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6920 <?php
6921 endforeach;
6922 ?>
6923 </select>
6924 </div>
6925 </div> <!-- Crosshair trigger -->
6926 <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">
6927 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6928 <label for="ays-chart-option-crosshair-orientation">
6929 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6930 <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") ); ?>">
6931 <i class="ays_fa ays_fa_info_circle"></i>
6932 </a>
6933 </label>
6934 </div>
6935 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6936 <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]">
6937 <?php
6938 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6939 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6940 ?>
6941 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6942 <?php
6943 endforeach;
6944 ?>
6945 </select>
6946 </div>
6947 </div> <!-- Crosshair orientation -->
6948 <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">
6949 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6950 <label for="ays-chart-option-crosshair-opacity" class="form-label">
6951 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
6952 <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") ); ?>">
6953 <i class="ays_fa ays_fa_info_circle"></i>
6954 </a>
6955 </label>
6956 </div>
6957 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6958 <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">
6959 </div>
6960 </div> <!-- Crosshair opacity -->
6961 <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">
6962 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6963 <label for="ays-chart-option-dash-style" class="form-label">
6964 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
6965 <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") ); ?>">
6966 <i class="ays_fa ays_fa_info_circle"></i>
6967 </a>
6968 </label>
6969 </div>
6970 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6971 <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) ?>">
6972 </div>
6973 </div> <!-- Line dash pattern -->
6974 <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">
6975 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6976 <label for="ays-chart-option-donut-hole-size">
6977 <?php echo esc_html(__( "Hole size", 'chart-builder' )); ?>
6978 </label>
6979 </div>
6980 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right <?php echo esc_attr($html_class_prefix) ?>option-input">
6981 <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) ?>">
6982 </div>
6983 </div> <!-- Donut hole size -->
6984 <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">
6985 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6986 <div class="ays-pro-features-v2-video-button"></div>
6987 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6988 <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>
6989 <div class="ays-pro-features-v2-upgrade-text">
6990 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
6991 </div>
6992 </a>
6993 </div>
6994 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix )?>option-title">
6995 <label for="ays-chart-option-curve-type">
6996 <?php echo esc_html(__( "Line curve type", "chart-builder" )); ?>
6997 </label>
6998 </div>
6999 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7000 <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]">
7001 <option><?php echo esc_html(__( "Straight", "chart-builder" )); ?></option>
7002 </select>
7003 </div>
7004 </div> <!-- Line curve type -->
7005 <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">
7006 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7007 <label for="ays-chart-option-allow-collapse">
7008 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
7009 <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") ); ?>">
7010 <i class="ays_fa ays_fa_info_circle"></i>
7011 </a>
7012 </label>
7013 </div>
7014 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7015 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7016 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-allow-collapse" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[allow_collapse]" value="on" <?php echo esc_attr($allow_collapse); ?> >
7017 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7018 </label>
7019 </div>
7020 </div> <!-- Allow collapse -->
7021 <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">
7022 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7023 <label for="ays-chart-option-org-node-description-font-color">
7024 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
7025 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
7026 <i class="ays_fa ays_fa_info_circle"></i>
7027 </a>
7028 </label>
7029 </div>
7030 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7031 <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) ?>">
7032 </div>
7033 </div> <!-- Org Node Description color -->
7034 <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">
7035 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7036 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
7037 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
7038 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
7039 <i class="ays_fa ays_fa_info_circle"></i>
7040 </a>
7041 </label>
7042 </div>
7043 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7044 <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) ?>">
7045 </div>
7046 </div> <!-- Org Node Description font size -->
7047 <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">
7048 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7049 <label for="ays-chart-option-org-classname" class="form-label">
7050 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
7051 <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") ); ?>">
7052 <i class="ays_fa ays_fa_info_circle"></i>
7053 </a>
7054 </label>
7055 </div>
7056 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7057 <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) ?>">
7058 </div>
7059 </div> <!-- Org custom class -->
7060 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
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" style="background:transparent;box-shadow:unset;padding:10px 0">
7062 <br>
7063 <blockquote>
7064 <?php echo sprintf(
7065 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7066 esc_html(__( '%1$sNote:%2$s Custom CSS class must be set for the options below to take effect.', 'chart-builder' )), '<strong>', '</strong>'); ?>
7067 </blockquote>
7068 <br>
7069 </div>
7070 <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">
7071 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7072 <label for="ays-chart-option-org-node-background-color">
7073 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7074 <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") ); ?>">
7075 <i class="ays_fa ays_fa_info_circle"></i>
7076 </a>
7077 </label>
7078 </div>
7079 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7080 <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) ?>">
7081 </div>
7082 </div> <!-- Org Node Background color -->
7083 <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">
7084 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7085 <label for="ays-chart-option-org-node-padding" class="form-label">
7086 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
7087 <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") ); ?>">
7088 <i class="ays_fa ays_fa_info_circle"></i>
7089 </a>
7090 </label>
7091 </div>
7092 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7093 <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) ?>">
7094 </div>
7095 </div> <!-- Org Node Padding -->
7096 <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">
7097 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7098 <label for="ays-chart-option-org-node-border-radius" class="form-label">
7099 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
7100 <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") ); ?>">
7101 <i class="ays_fa ays_fa_info_circle"></i>
7102 </a>
7103 </label>
7104 </div>
7105 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7106 <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) ?>">
7107 </div>
7108 </div> <!-- Org Node Border radius -->
7109 <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">
7110 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7111 <label for="ays-chart-option-org-node-border-width" class="form-label">
7112 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
7113 <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") ); ?>">
7114 <i class="ays_fa ays_fa_info_circle"></i>
7115 </a>
7116 </label>
7117 </div>
7118 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7119 <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) ?>">
7120 </div>
7121 </div> <!-- Org Node Border width -->
7122 <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">
7123 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7124 <label for="ays-chart-option-org-node-border-color">
7125 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
7126 <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") ); ?>">
7127 <i class="ays_fa ays_fa_info_circle"></i>
7128 </a>
7129 </label>
7130 </div>
7131 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7132 <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) ?>">
7133 </div>
7134 </div> <!-- Org Node Background color -->
7135 <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">
7136 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7137 <label for="ays-chart-option-org-node-text-color">
7138 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7139 <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") ); ?>">
7140 <i class="ays_fa ays_fa_info_circle"></i>
7141 </a>
7142 </label>
7143 </div>
7144 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7145 <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) ?>">
7146 </div>
7147 </div> <!-- Org Node Text color -->
7148 <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">
7149 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7150 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
7151 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
7152 <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") ); ?>">
7153 <i class="ays_fa ays_fa_info_circle"></i>
7154 </a>
7155 </label>
7156 </div>
7157 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7158 <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) ?>">
7159 </div>
7160 </div> <!-- Org Node Text font size -->
7161 </div> <!-- Org custom class options -->
7162 <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">
7163 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7164 <label for="ays-chart-option-org-selected-classname" class="form-label">
7165 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
7166 <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") ); ?>">
7167 <i class="ays_fa ays_fa_info_circle"></i>
7168 </a>
7169 </label>
7170 </div>
7171 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7172 <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) ?>">
7173 </div>
7174 </div> <!-- Org custom selected class -->
7175 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
7176 <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">
7177 <br>
7178 <blockquote>
7179 <?php echo sprintf(
7180 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7181 esc_html(__( '%1$sNote:%2$s Selected node custom CSS class must be set for the options below to take effect.', 'chart-builder' )),
7182 '<strong>',
7183 '</strong>'
7184 ); ?>
7185 </blockquote>
7186 <br>
7187 </div>
7188 <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">
7189 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7190 <label for="ays-chart-option-org-selected-node-background-color">
7191 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7192 <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") ); ?>">
7193 <i class="ays_fa ays_fa_info_circle"></i>
7194 </a>
7195 </label>
7196 </div>
7197 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7198 <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) ?>">
7199 </div>
7200 </div> <!-- Org selected Node Background color -->
7201 <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">
7202 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7203 <label for="ays-chart-option-org-selected-node-text-color">
7204 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7205 <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") ); ?>">
7206 <i class="ays_fa ays_fa_info_circle"></i>
7207 </a>
7208 </label>
7209 </div>
7210 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7211 <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) ?>">
7212 </div>
7213 </div> <!-- Org selected Node text color -->
7214 </div> <!-- Org custom selected class options -->
7215 </div>
7216 </div>
7217 <?php
7218 $content = ob_get_clean();
7219
7220 $sources['advanced_settings'] = array(
7221 'content' => $content,
7222 'title' => $tab_title
7223 );
7224
7225 return $sources;
7226 }
7227
7228 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
7229 $html_class_prefix = $args['html_class_prefix'];
7230 $html_name_prefix = $args['html_name_prefix'];
7231 $settings = $args['settings'];
7232 $tab_title = $args['tab_name'];
7233
7234 $outer_radius = $settings['outer_radius'];
7235 $slice_spacing = $settings['slice_spacing'];
7236 $circumference = $settings['circumference'];
7237 $start_angle = $settings['start_angle'];
7238 // $index_axis = $settings['index_axis'];
7239
7240 ob_start();
7241 ?>
7242 <div class="ays-accordion-data-main-wrap">
7243 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
7244 <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">
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-outer-radius" class="form-label">
7247 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
7248 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","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) ?>option-input">
7254 <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) ?>">
7255 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7256 </div>
7257 </div> <!-- Outer Radius -->
7258 <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">
7259 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7260 <label for="ays-chart-option-slice-spacing" class="form-label">
7261 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
7262 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
7263 <i class="ays_fa ays_fa_info_circle"></i>
7264 </a>
7265 </label>
7266 </div>
7267 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7268 <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) ?>">
7269 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7270 </div>
7271 </div> <!-- Slice Spacing -->
7272 <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">
7273 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7274 <label for="ays-chart-option-circumference" class="form-label">
7275 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
7276 <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") ); ?>">
7277 <i class="ays_fa ays_fa_info_circle"></i>
7278 </a>
7279 </label>
7280 </div>
7281 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7282 <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) ?>">
7283 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7284 </div>
7285 </div> <!-- Arc Coverage -->
7286 <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">
7287 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7288 <label for="ays-chart-option-start-angle" class="form-label">
7289 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
7290 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
7291 <i class="ays_fa ays_fa_info_circle"></i>
7292 </a>
7293 </label>
7294 </div>
7295 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7296 <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) ?>">
7297 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7298 </div>
7299 </div> <!-- Start Angle -->
7300 <!-- <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">
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-index-axis">
7303 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
7304 <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") ); ?>">
7305 <i class="ays_fa ays_fa_info_circle"></i>
7306 </a>
7307 </label>
7308 </div>
7309 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
7310 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7311 <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); ?> >
7312 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7313 </label>
7314 </div>
7315 </div> Reverse Categories -->
7316 </div>
7317 </div>
7318 <?php
7319 $content = ob_get_clean();
7320
7321 $sources['advanced_settings'] = array(
7322 'content' => $content,
7323 'title' => $tab_title
7324 );
7325
7326 return $sources;
7327 }
7328
7329 public function settings_contents_slices_settings( $sources, $args ){
7330 $html_class_prefix = $args['html_class_prefix'];
7331 $html_name_prefix = $args['html_name_prefix'];
7332 $settings = $args['settings'];
7333 $source = $args['source'];
7334 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7335 $source_chart_type = $args['source_chart_type'];
7336 $settings = $args['settings'];
7337 $title_row = array_shift($source);
7338
7339 if (isset($source) && !empty($source)) {
7340 if ( !isset( $source[0] ) ) {
7341 if (count($source[1]) > 2) {
7342 $titles = array();
7343 for ($i = 0; $i < count($source[1]); $i++) {
7344 array_push($titles, __("Title", 'chart-builder').$i);
7345 }
7346 $source[0] = $titles;
7347 } else {
7348 $source[0] = array(
7349 __("Country", 'chart-builder'),
7350 __("Population", 'chart-builder'),
7351 );
7352 }
7353
7354 ksort($source);
7355 }
7356 }
7357
7358 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7359 foreach ($source as $key => $row) {
7360 $source[$key] = array_slice($row, 0, 2);
7361 }
7362 }
7363
7364 ob_start();
7365 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7366 $slice_color = $settings['slice_color'];
7367 $slice_colors_default = $settings['slice_colors_default'];
7368 $slice_offset = $settings['slice_offset'];
7369 $slice_text_color = $settings['slice_text_color'];
7370
7371 ?>
7372 <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">
7373 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7374 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
7375 <?php
7376 foreach ( $source as $key => $val ):
7377 ?>
7378 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
7379 <legend class="ays-slices-accordion-options-header">
7380 <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">
7381 <g>
7382 <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" />
7383 </g>
7384 </svg>
7385 <span><?php echo esc_html($val[0]); ?></span>
7386 </legend>
7387 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
7388 <div class="ays-slices-accordion-data-main-wrap">
7389 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7390 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7391 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7392 <label for="ays-chart-option-slice-color">
7393 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7394 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
7395 <i class="ays_fa ays_fa_info_circle"></i>
7396 </a>
7397 </label>
7398 </div>
7399 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7400 <input type="color"
7401 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
7402 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7403 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
7404 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
7405 data-slice-id="<?php echo esc_attr($key); ?>">
7406 </div>
7407 </div> <!-- Slice color -->
7408 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7409 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7410 <label for="ays-chart-option-slice-offset" class="form-label">
7411 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
7412 <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") ); ?>">
7413 <i class="ays_fa ays_fa_info_circle"></i>
7414 </a>
7415 </label>
7416 </div>
7417 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7418 <input type="number"
7419 id="ays-chart-option-slice-offset-<?php echo esc_attr($key); ?>"
7420 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7421 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo esc_attr($key); ?>]"
7422 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
7423 data-slice-id="<?php echo esc_attr($key); ?>"
7424 step=".01" min="0.0" max="1.0">
7425 </div>
7426 </div> <!-- Slice offset -->
7427 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7428 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7429 <label for="ays-chart-option-slice-text-color">
7430 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7431 <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") ); ?>">
7432 <i class="ays_fa ays_fa_info_circle"></i>
7433 </a>
7434 </label>
7435 </div>
7436 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7437 <input type="color"
7438 id="ays-chart-option-slice-text-color-<?php echo esc_attr($key); ?>"
7439 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7440 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo esc_attr($key); ?>]"
7441 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
7442 data-slice-id="<?php echo esc_attr($key); ?>">
7443 </div>
7444 </div> <!-- Slice color -->
7445 </div>
7446 </div>
7447 </div>
7448 </fieldset>
7449 <?php
7450 endforeach;
7451 ?>
7452 </div>
7453 </div>
7454 <br>
7455 <blockquote>
7456 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
7457 </blockquote>
7458 </div>
7459 <?php
7460
7461 } else {
7462 ?>
7463 <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>
7464 <?php
7465 }
7466
7467 $content = ob_get_clean();
7468
7469 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
7470
7471 $sources['slices_settings'] = array(
7472 'content' => $content,
7473 'title' => $title
7474 );
7475
7476 return $sources;
7477 }
7478
7479 public function settings_contents_series_settings( $sources, $args ){
7480 $html_class_prefix = $args['html_class_prefix'];
7481 $html_name_prefix = $args['html_name_prefix'];
7482 $settings = $args['settings'];
7483 $source = $args['source'];
7484 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7485 $source_chart_type = $args['source_chart_type'];
7486
7487 $line_width = $settings['line_width'];
7488 $point_size = $settings['point_size'];
7489 $point_shape_options = $settings['point_shape_options'];
7490 $point_shape = $settings['point_shape'];
7491
7492 if (isset($source) && !empty($source)) {
7493 if ( !isset( $source[0] ) ) {
7494 if (count($source[1]) > 2) {
7495 $titles = array();
7496 for ($i = 0; $i < count($source[1]); $i++) {
7497 array_push($titles, __("Title", "chart-builder").$i);
7498 }
7499 $source[0] = $titles;
7500 } else {
7501 $source[0] = array(
7502 __("Country", "chart-builder"),
7503 __("Population", "chart-builder"),
7504 );
7505 }
7506
7507 ksort($source);
7508 }
7509 }
7510
7511 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7512 foreach ($source as $key => $row) {
7513 $source[$key] = array_slice($row, 0, 2);
7514 }
7515 }
7516
7517 ob_start();
7518 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
7519 $series_row = array_shift($source);
7520 $title = array_shift($series_row);
7521 $series_color = $settings['series_color'];
7522 $series_colors_default = $settings['series_colors_default'];
7523 $series_visible_in_legend = $settings['series_visible_in_legend'];
7524 $series_line_width = $settings['series_line_width'];
7525 $series_point_size = $settings['series_point_size'];
7526 $series_point_shape = $settings['series_point_shape'];
7527
7528 ?>
7529 <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">
7530 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7531 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
7532 <?php
7533 foreach ( $series_row as $key => $val ):
7534 ?>
7535 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
7536 <legend class="ays-series-accordion-options-header">
7537 <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">
7538 <g>
7539 <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" />
7540 </g>
7541 </svg>
7542 <span><?php echo esc_attr($val); ?></span>
7543 </legend>
7544 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
7545 <div class="ays-series-accordion-data-main-wrap">
7546 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7547 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7548 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7549 <label for="ays-chart-option-series-color">
7550 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7551 </label>
7552 </div>
7553 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7554 <input type="color"
7555 id="ays-chart-option-series-color-<?php echo esc_attr($key); ?>"
7556 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7557 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo esc_attr($key); ?>]"
7558 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : esc_attr($series_colors_default[$key]); ?>"
7559 data-series-id="<?php echo esc_attr($key); ?>">
7560 </div>
7561 </div> <!-- series color -->
7562 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7563 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7564 <label for="ays-chart-option-series-visible-in-legend">
7565 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
7566 <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") ); ?>">
7567 <i class="ays_fa ays_fa_info_circle"></i>
7568 </a>
7569 </label>
7570 </div>
7571 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7572 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7573 <input type="checkbox"
7574 id="ays-chart-option-series-visible-in-legend-<?php echo esc_attr($key); ?>"
7575 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
7576 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo esc_attr($key); ?>]"
7577 value="on"
7578 data-series-id="<?php echo esc_attr($key); ?>"
7579 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
7580 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7581 </label>
7582 </div>
7583 </div> <!-- Series visible in legend -->
7584 <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">
7585 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7586 <label for="ays-chart-option-series-line-width">
7587 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
7588 <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") ); ?>">
7589 <i class="ays_fa ays_fa_info_circle"></i>
7590 </a>
7591 </label>
7592 </div>
7593 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7594 <input type="number"
7595 id="ays-chart-option-series-line-width-<?php echo esc_attr($key); ?>"
7596 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7597 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo esc_attr($key); ?>]"
7598 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : esc_attr($line_width); ?>"
7599 data-series-id="<?php echo esc_attr($key); ?>">
7600 </div>
7601 </div> <!-- Line width -->
7602 <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">
7603 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7604 <label for="ays-chart-option-series-point-size">
7605 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7606 <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") ); ?>">
7607 <i class="ays_fa ays_fa_info_circle"></i>
7608 </a>
7609 </label>
7610 </div>
7611 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7612 <input type="number"
7613 id="ays-chart-option-series-point-size-<?php echo esc_attr($key); ?>"
7614 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7615 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo esc_attr($key); ?>]"
7616 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : esc_attr($point_size); ?>"
7617 data-series-id="<?php echo esc_attr($key); ?>">
7618 </div>
7619 </div> <!-- Point size -->
7620 <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">
7621 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7622 <label for="ays-chart-option-series-point-shape">
7623 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7624 <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") ); ?>">
7625 <i class="ays_fa ays_fa_info_circle"></i>
7626 </a>
7627 </label>
7628 </div>
7629 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7630 <select
7631 id="ays-chart-option-series-point-shape-<?php echo esc_attr($key); ?>"
7632 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
7633 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo esc_attr($key); ?>]"
7634 data-series-id="<?php echo esc_attr($key); ?>">
7635 >
7636 <?php
7637 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
7638 foreach ( $point_shape_options as $option_slug => $option ):
7639 $selected = ( $value === $option_slug ) ? 'selected' : '';
7640 ?>
7641 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7642 <?php
7643 endforeach;
7644 ?>
7645 </select>
7646 </div>
7647 </div> <!-- Point shape -->
7648 </div>
7649 </div>
7650 </div>
7651 </fieldset>
7652 <?php
7653 endforeach;
7654 ?>
7655 </div>
7656 </div>
7657 <br>
7658 <blockquote>
7659 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
7660 <br>
7661 <?php echo sprintf(
7662 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7663 esc_html(__( '%1$sNote:%2$s If you are not able to set the options, disable the row settings feature.', 'chart-builder' )),
7664 '<strong>',
7665 '</strong>'
7666 ); ?>
7667 </blockquote>
7668 </div>
7669 <?php
7670
7671 } else {
7672 ?>
7673 <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>
7674 <?php
7675 }
7676
7677 $content = ob_get_clean();
7678
7679 $title = __( 'Series settings', "chart-builder" );
7680
7681 $sources['series_settings'] = array(
7682 'content' => $content,
7683 'title' => $title
7684 );
7685
7686 return $sources;
7687 }
7688
7689 public function settings_contents_row_settings( $sources, $args ){
7690 $html_class_prefix = $args['html_class_prefix'];
7691 $html_name_prefix = $args['html_name_prefix'];
7692 $settings = $args['settings'];
7693 $source = $args['source'];
7694 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7695 $source_chart_type = $args['source_chart_type'];
7696
7697 if (isset($source) && !empty($source)) {
7698 if ( !isset( $source[0] ) ) {
7699 if (count($source[1]) > 2) {
7700 $titles = array();
7701 for ($i = 0; $i < count($source[1]); $i++) {
7702 array_push($titles, __("Title", 'chart-builder').$i);
7703 }
7704 $source[0] = $titles;
7705 } else {
7706 $source[0] = array(
7707 __("Country", 'chart-builder'),
7708 __("Population", 'chart-builder'),
7709 );
7710 }
7711
7712 ksort($source);
7713 }
7714 }
7715
7716 array_shift($source);
7717 $rows = array_column($source, 0);
7718
7719 $enable_row_settings = $settings['enable_row_settings'];
7720 $series_color = $settings['series_color'][0] ?? '#3366cc';
7721 $rows_color = $settings['rows_color'];
7722 $rows_opacity = $settings['rows_opacity'];
7723
7724 ob_start();
7725 ?>
7726 <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">
7727 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7728 <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">
7729 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7730 <label for="ays-chart-option-enable-row-settings">
7731 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7732 <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") ); ?>">
7733 <i class="ays_fa ays_fa_info_circle"></i>
7734 </a>
7735 </label>
7736 </div>
7737 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7738 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7739 <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); ?> >
7740 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7741 </label>
7742 </div>
7743 </div> <!-- Enable row settings -->
7744 <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'; ?>">
7745 <br>
7746 <?php
7747 foreach ( $rows as $key => $val ):
7748 ?>
7749 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7750 <legend class="ays-rows-accordion-options-header">
7751 <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">
7752 <g>
7753 <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" />
7754 </g>
7755 </svg>
7756 <span><?php echo esc_html($val); ?></span>
7757 </legend>
7758 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7759 <div class="ays-rows-accordion-data-main-wrap">
7760 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7761 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7762 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7763 <label for="ays-chart-option-rows-color">
7764 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7765 </label>
7766 </div>
7767 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7768 <input type="color"
7769 id="ays-chart-option-rows-color-<?php echo esc_attr($key); ?>"
7770 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7771 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo esc_attr($key); ?>]"
7772 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : esc_attr($series_color); ?>"
7773 data-rows-id="<?php echo esc_attr($key); ?>">
7774 </div>
7775 </div> <!-- color -->
7776 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7777 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7778 <label for="ays-chart-option-rows-color">
7779 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7780 </label>
7781 </div>
7782 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7783 <input type="number"
7784 id="ays-chart-option-rows-opacity-<?php echo esc_attr($key); ?>"
7785 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7786 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo esc_attr($key); ?>]"
7787 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7788 data-rows-id="<?php echo esc_attr($key); ?>"
7789 step=".1" min="0" max="1">
7790 </div>
7791 </div> <!-- opacity -->
7792 </div>
7793 </div>
7794 </div>
7795 </fieldset>
7796 <?php
7797 endforeach;
7798 ?>
7799 <br>
7800 <blockquote>
7801 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
7802 <br>
7803 <?php echo sprintf(
7804 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7805 esc_html(__( '%1$sNote:%2$s The applied styles will work only if the chart has one column.', 'chart-builder' )),
7806 '<strong>',
7807 '</strong>'
7808 ); ?>
7809 </blockquote>
7810 </div>
7811 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7812 <br>
7813 <blockquote>
7814 <?php echo sprintf(
7815 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7816 esc_html(__( '%1$sNote:%2$s If this option is disabled, the general options will be set from the series settings.', 'chart-builder' )),
7817 '<strong>',
7818 '</strong>'
7819 ); ?>
7820 </blockquote>
7821 </div>
7822 </div>
7823 </div>
7824 <?php
7825 $content = ob_get_clean();
7826
7827 $title = __( 'Row settings', "chart-builder" );
7828
7829 $sources['row_settings'] = array(
7830 'content' => $content,
7831 'title' => $title
7832 );
7833
7834 return $sources;
7835 }
7836 }
7837