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

7,228 lines 517.2 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', '' );
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', $this->plugin_name ),
253 'delete' => __( 'Delete', $this->plugin_name ),
254 'selectQuestionDefaultType' => __( 'Select question default type', $this->plugin_name ),
255 'yes' => __( 'Yes', $this->plugin_name ),
256 'cancel' => __( 'Cancel', $this->plugin_name ),
257 'somethingWentWrong' => __( "Maybe something went wrong.", $this->plugin_name ),
258 'failed' => __( 'Failed', $this->plugin_name ),
259 'selectPage' => __( 'Select page', $this->plugin_name ),
260 'selectPostType' => __( 'Select post type', $this->plugin_name ),
261 'copied' => __( 'Copied!', $this->plugin_name),
262 'clickForCopy' => __( 'Click to copy', $this->plugin_name),
263 'selectForm' => __( 'Select form', $this->plugin_name),
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', $this->plugin_name),
319 __('All Charts', $this->plugin_name),
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', $this->plugin_name),
332 __('Add New', $this->plugin_name),
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', $this->plugin_name),
344 __('How to use', $this->plugin_name),
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', $this->plugin_name),
355 __('General Settings', $this->plugin_name),
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', $this->plugin_name),
366 __('Our products', $this->plugin_name),
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', $this->plugin_name),
379 __('PRO Features', $this->plugin_name),
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 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
397 add_screen_option( $option, $args );
398 }
399
400 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
401 }
402
403 public function screen_option_settings(){
404 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
405 }
406
407 public function add_tabs() {
408 $screen = get_current_screen();
409
410 if ( ! $screen) {
411 return;
412 }
413 }
414
415 public function display_plugin_charts_page(){
416 global $ays_chart_db_actions;
417
418 $action = (isset($_GET['action'])) ? sanitize_text_field( $_GET['action'] ) : '';
419 $id = (isset($_GET['id'])) ? absint( esc_attr($_GET['id']) ) : 0;
420
421 if (isset($_POST['bulk_delete_confirm'])) {
422 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
423 $ids = $_POST['bulk-delete'];
424 foreach ($ids as $id) {
425 if ($id > 0) {
426 $this->db_obj->delete_item( $id );
427 }
428 }
429 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
430 $url = esc_url_raw( add_query_arg( array(
431 "status" => 'all-deleted'
432 ), $url ) );
433 wp_redirect( $url );
434 exit;
435 }
436 }
437
438 switch ($action) {
439 case 'trash':
440 if( $id > 0 ){
441 $this->db_obj->trash_item( $id );
442 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
443 $url = esc_url_raw( add_query_arg( array(
444 "status" => 'trashed'
445 ), $url ) );
446 wp_redirect( $url );
447 exit;
448 }
449 break;
450 case 'restore':
451 if( $id > 0 ){
452 $this->db_obj->restore_item( $id );
453 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
454 $url = esc_url_raw( add_query_arg( array(
455 "status" => 'restored'
456 ), $url ) );
457 wp_redirect( $url );
458 exit;
459 }
460 break;
461 case 'delete':
462 if( $id > 0 ){
463 $this->db_obj->delete_item( $id );
464 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
465 $url = esc_url_raw( add_query_arg( array(
466 "status" => 'deleted'
467 ), $url ) );
468 wp_redirect( $url );
469 exit;
470 }
471 break;
472 case 'publish':
473 if( $id > 0 ){
474 $this->db_obj->publish_item( $id );
475 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
476 $url = esc_url_raw( add_query_arg( array(
477 "status" => 'published'
478 ), $url ) );
479 wp_redirect( $url );
480 exit;
481 }
482 break;
483 case 'unpublish':
484 if( $id > 0 ){
485 $this->db_obj->restore_item( $id );
486 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
487 $url = esc_url_raw( add_query_arg( array(
488 "status" => 'unpublished'
489 ), $url ) );
490 wp_redirect( $url );
491 exit;
492 }
493 break;
494 case 'duplicate':
495 if( $id > 0 ){
496 $this->db_obj->duplicate_item( $id );
497 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
498 $url = esc_url_raw( add_query_arg( array(
499 "status" => 'duplicated'
500 ), $url ) );
501 wp_redirect( $url );
502 exit;
503 }
504 break;
505 case 'add':
506 include_once('partials/charts/actions/chart-builder-charts-actions.php');
507 break;
508 case 'edit':
509 include_once('partials/charts/actions/chart-builder-charts-actions.php');
510 break;
511 default:
512 include_once('partials/charts/chart-builder-charts-display.php');
513 }
514 }
515
516 public function display_plugin_setup_page(){
517 include_once('partials/chart-builder-admin-display.php');
518 }
519
520 public function display_plugin_addnew_page(){
521
522 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
523 // $url = esc_url_raw( add_query_arg( array(
524 // "action" => 'add'
525 // ), $url ) );
526 // wp_redirect( $url );
527 }
528
529 public function display_plugin_settings_page(){
530 include_once('partials/settings/chart-builder-settings.php');
531 }
532
533 public function display_plugin_featured_plugins_page(){
534 include_once('partials/features/chart-builder-plugin-featured-display.php');
535 }
536
537 public function display_plugin_chart_features_page(){
538 include_once('partials/features/chart-builder-features-display.php');
539 }
540
541 /**
542 * Add settings action link to the plugins page.
543 *
544 * @since 1.0.0
545 */
546 public function add_action_links( $links ){
547
548 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
549
550 /*
551 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
552 */
553 $settings_link = array(
554 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
555 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
556 // '<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>',
557 '<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>
558 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
559 );
560 return array_merge( $settings_link, $links );
561
562 }
563
564
565 public static function set_screen($status, $option, $value){
566 return $value;
567 }
568
569 public function ays_admin_ajax(){
570 global $wpdb;
571
572 $response = array(
573 "status" => false
574 );
575
576 $function = isset($_REQUEST['function']) ? sanitize_text_field( $_REQUEST['function'] ) : null;
577
578 if($function !== null){
579 $response = array();
580 if( is_callable( array( $this, $function ) ) ){
581 $response = $this->$function();
582
583 ob_end_clean();
584 $ob_get_clean = ob_get_clean();
585 echo json_encode( $response );
586 wp_die();
587 }
588
589 }
590
591 ob_end_clean();
592 $ob_get_clean = ob_get_clean();
593 echo json_encode( $response );
594 wp_die();
595 }
596
597 public function deactivate_plugin_option(){
598 // Run a security check.
599 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
600
601 // Check for permissions.
602 if ( ! current_user_can( 'manage_options' ) ) {
603 ob_end_clean();
604 $ob_get_clean = ob_get_clean();
605 echo json_encode(array(
606 'option' => ''
607 ));
608 wp_die();
609 }
610
611 if( is_user_logged_in() ) {
612 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( $_REQUEST['upgrade_plugin'] ) : '';
613 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
614
615 if ( $upgrade_option === '' ) {
616 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
617 } else {
618 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
619 }
620
621 $response = array(
622 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
623 );
624
625 wp_send_json_success( $response );
626 } else {
627 ob_end_clean();
628 $ob_get_clean = ob_get_clean();
629 echo json_encode(array(
630 'option' => ''
631 ));
632 wp_die();
633 }
634 }
635
636 public function chart_builder_admin_footer($a){
637 if(isset($_REQUEST['page'])){
638 if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
639 ?>
640 <div class="ays-chart-footer-support-box">
641 <span class="ays-chart-footer-link-row"><a href="https://wordpress.org/support/plugin/chart-builder" target="_blank"><?php echo __( "Support", "chart-builder"); ?></a></span>
642 <span class="ays-chart-footer-slash-row">/</span>
643 <span class="ays-chart-footer-link-row"><a href="https://ays-pro.com/wordpress-chart-builder-plugin-user-manual" target="_blank"><?php echo __( "Docs", "chart-builder"); ?></a></span>
644 <span class="ays-chart-footer-slash-row">/</span>
645 <span class="ays-chart-footer-link-row"><a href="https://ays-demo.com/chart-builder-plugin-suggestion-box" target="_blank"><?php echo __( "Suggest a Feature", "chart-builder"); ?></a></span>
646 </div>
647 <p style="font-size:13px;text-align:center;font-style:italic;">
648 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
649 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
650 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
651 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
652 </p>
653 <?php
654 }
655 }
656 }
657
658 // Chart Builder Elementor widget init
659 public function chart_builder_el_widgets_registered() {
660 // We check if the Elementor plugin has been installed / activated.
661 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
662 // get our own widgets up and running:
663 // copied from widgets-manager.php
664 if ( class_exists( 'Elementor\Plugin' ) ) {
665 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
666 $elementor = Elementor\Plugin::instance();
667 if ( isset( $elementor->widgets_manager ) ) {
668 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
669 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
670 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
671 $template_file = locate_template( $widget_file );
672 if ( !$template_file || !is_readable( $template_file ) ) {
673 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
674 }
675 if ( $template_file && is_readable( $template_file ) ) {
676 require_once $template_file;
677 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
678 }
679 }
680 }
681 }
682 }
683 }
684 }
685
686 public function fetch_post_type_props(){
687 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( $_POST['nonce'] ), 'cbuilder-fetch-post-type-props' ) : '';
688 if ( $nonce ) {
689 $results = CBFunctions()->get_post_type_properties( sanitize_text_field( $_POST['post_type'] ) );
690
691 return array(
692 'success' => true,
693 'fields' => $results,
694 );
695 }
696
697 return array(
698 'success' => false,
699 );
700 }
701
702 public static function get_max_id( $table ) {
703 global $wpdb;
704 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
705
706 $sql = "SELECT MAX(id) FROM {$db_table}";
707
708 $result = intval( $wpdb->get_var( $sql ) );
709
710 return $result;
711 }
712
713 public static function ays_restriction_string($type, $x, $length){
714 $output = "";
715 switch($type){
716 case "char":
717 if(strlen($x)<=$length){
718 $output = $x;
719 } else {
720 $output = substr($x,0,$length) . '...';
721 }
722 break;
723 case "word":
724 $res = explode(" ", $x);
725 if(count($res)<=$length){
726 $output = implode(" ",$res);
727 } else {
728 $res = array_slice($res,0,$length);
729 $output = implode(" ",$res) . '...';
730 }
731 break;
732 }
733 return $output;
734 }
735
736 public function ays_chart_sale_banner(){
737 // 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' )) {
738 // update_option('ays_chart_sale_btn', 1);
739 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
740 // }
741
742 $ays_chart_sale_date = get_option('ays_chart_sale_date');
743
744 $val = 60*60*24*5;
745
746 $current_date = current_time( 'mysql' );
747 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
748
749 $days_diff = $date_diff / $val;
750
751 if(intval($days_diff) > 0 ){
752 update_option('ays_chart_sale_btn', 0);
753 }
754
755 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
756 if( $ays_chart_builder_flag == 0 ){
757 if (isset($_GET['page']) && strpos($_GET['page'], CHART_BUILDER_NAME) !== false) {
758 if( !(Chart_Builder_Admin::get_max_id('charts') <= 1) ){
759 // $this->ays_chart_sale_message_30_emma($ays_chart_builder_flag);
760 // $this->ays_chart_sale_message20($ays_chart_builder_flag);
761 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
762 // $this->ays_chart_black_friday_message($ays_chart_builder_flag);
763 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
764 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
765 $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
766 }
767 }
768 }
769 }
770
771 public function ays_chart_dismiss_button(){
772
773 $data = array(
774 'status' => false,
775 );
776
777 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
778 if( (isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( $_REQUEST['_ajax_nonce'], $this->plugin_name . '-sale-banner' )) && current_user_can( 'manage_options' )){
779 update_option('ays_chart_sale_btn', 1);
780 update_option('ays_chart_sale_date', current_time( 'mysql' ));
781 $data['status'] = true;
782 }
783 }
784
785 ob_end_clean();
786 $ob_get_clean = ob_get_clean();
787 echo json_encode($data);
788 wp_die();
789
790 }
791
792 // 30% Sale Emma
793 public function ays_chart_sale_message_30_emma($ishmar){
794 if($ishmar == 0 ){
795 $content = array();
796 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
797 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
798
799 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
800 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
801
802 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
803 $content[] = '<div>
804 <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;">
805 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
806 </div>';
807 $content[] = '</div>';
808
809 $content[] = '<div style="font-size: 17px;">';
810 $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(CHART_BUILDER_ADMIN_URL) . '/images/icons/guarantee-new.png">';
811 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
812
813 $content[] = '</div>';
814
815
816
817 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
818
819 $content[] = '<form action="" method="POST">';
820 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
821 if( current_user_can( 'manage_options' ) ){
822 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
823 ">Dismiss ad</button>';
824 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
825 }
826 $content[] = '</div>';
827 $content[] = '</form>';
828
829 $content[] = '</div>';
830
831 $content[] = '</div>';
832
833 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
834
835 $content[] = '<div id="ays-chart-countdown-main-container">';
836 $content[] = '<div class="ays-chart-countdown-container">';
837
838 $content[] = '<div id="ays-chart-countdown">';
839
840 $content[] = '<div style="font-weight: 500;">';
841 $content[] = __( "Offer ends in:", "chart-builder" );
842 $content[] = '</div>';
843
844 $content[] = '<ul>';
845 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
846 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
847 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
848 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
849 $content[] = '</ul>';
850 $content[] = '</div>';
851
852 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
853 $content[] = '<span>🚀</span>';
854 $content[] = '<span>⌛</span>';
855 $content[] = '<span>🔥</span>';
856 $content[] = '<span>💣</span>';
857 $content[] = '</div>';
858
859 $content[] = '</div>';
860 $content[] = '</div>';
861
862 $content[] = '</div>';
863
864 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
865 $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>';
866 $content[] = '<span >One-time payment</span>';
867 $content[] = '</div>';
868 $content[] = '</div>';
869 $content[] = '</div>';
870
871 $content = implode( '', $content );
872 echo html_entity_decode(esc_html( $content ));
873 }
874 }
875
876 // Self 20% sale
877 public static function ays_chart_sale_message20($ishmar){
878 if($ishmar == 0 ){
879 $content = array();
880
881 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
882 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
883 // $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>';
884
885 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
886
887 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
888 $content[] = '<span class="ays-chart-new-chart-pro-title">';
889 $content[] = __( "<span><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:#ffffff; text-decoration: underline;'>Chart Builder</a></span>", CHART_BUILDER_NAME );
890 $content[] = '</span>';
891 $content[] = '<div>';
892 $content[] = '<img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-sale-30.svg" style="width: 70px;">';
893 $content[] = '</div>';
894 $content[] = '</div>';
895
896 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
897 $content[] = '<img class="ays-chart-new-chart-pro-guaranteeicon" src="' . CHART_BUILDER_ADMIN_URL . '/images/chart-builder-guaranteeicon.webp" style="width: 30px;">';
898 $content[] = __( "30 Days Money Back Guarantee", CHART_BUILDER_NAME );
899 $content[] = '</span>';
900
901 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
902 $content[] = '<form method="POST">';
903 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
904 if (current_user_can( 'manage_options' )) {
905 $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>';
906 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
907 }
908 $content[] = '</div>';
909 $content[] = '</form>';
910 $content[] = '</div>';
911
912 $content[] = '</div>';
913
914 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
915
916 $content[] = '<div id="ays-chart-countdown-main-container">';
917 $content[] = '<div class="ays-chart-countdown-container">';
918 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
919 $content[] = __( "Offer ends in:", CHART_BUILDER_NAME );
920
921 $content[] = '<ul style="padding: 0">';
922 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', CHART_BUILDER_NAME ) . '</li>';
923 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', CHART_BUILDER_NAME ) . '</li>';
924 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', CHART_BUILDER_NAME ) . '</li>';
925 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', CHART_BUILDER_NAME ) . '</li>';
926 $content[] = '</ul>';
927 $content[] = '</div>';
928
929 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
930 $content[] = '<span>🚀</span>';
931 $content[] = '<span>⌛</span>';
932 $content[] = '<span>🔥</span>';
933 $content[] = '<span>💣</span>';
934 $content[] = '</div>';
935 $content[] = '</div>';
936 $content[] = '</div>';
937
938 $content[] = '</div>';
939
940 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
941 $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" style="" >' . __( 'Buy Now', CHART_BUILDER_NAME ) . '</a>';
942 $content[] = '<span class="ays-chart-dicount-one-time-text">';
943 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
944 $content[] = '</span>';
945 $content[] = '</div>';
946
947 $content[] = '</div>';
948
949 $content[] = '</div>';
950
951 $content = implode( '', $content );
952 echo $content;
953 }
954 }
955
956 // Helloween banner
957 public static function ays_chart_helloween_message($ishmar){
958 if($ishmar == 0 ){
959 $content = array();
960
961 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
962 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
963 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
964
965 $content[] = '<p>';
966 $content[] = __( "Limited Time
967 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
968 <span>
969 SALE on
970 </span>
971 <br>
972 <span style='' class='ays-chart-helloween-bundle'>
973 <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;'>
974 Chart Builder
975 </a>
976 </span>", CHART_BUILDER_NAME );
977 $content[] = '</p>';
978 $content[] = '<p>';
979 $content[] = __( "Hurry up!
980 <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;'>
981 Check it out!
982 </a>", CHART_BUILDER_NAME );
983 $content[] = '</p>';
984
985 $content[] = '</div>';
986
987
988 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
989 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
990 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
991 $content[] = '<div class="ays-chart-countdown-container-helloween">';
992 $content[] = '<div id="ays-chart-countdown">';
993 $content[] = '<ul>';
994 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
995 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
996 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
997 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
998 $content[] = '</ul>';
999 $content[] = '</div>';
1000
1001 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1002 $content[] = '<span>🚀</span>';
1003 $content[] = '<span>⌛</span>';
1004 $content[] = '<span>🔥</span>';
1005 $content[] = '<span>💣</span>';
1006 $content[] = '</div>';
1007
1008 $content[] = '</div>';
1009
1010 $content[] = '</div>';
1011
1012 $content[] = '</div>';
1013 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1014 $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_NAME ) . '</a>';
1015 $content[] = '</div>';
1016 $content[] = '</div>';
1017
1018 $content[] = '</div>';
1019
1020 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1021 $content[] = '<form method="POST">';
1022 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1023 if( current_user_can( 'manage_options' ) ){
1024 $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>';
1025 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1026 }
1027 $content[] = '</div>';
1028 $content[] = '</form>';
1029
1030 $content[] = '</div>';
1031 // $content[] = '<button type="button" class="notice-dismiss">';
1032 // $content[] = '</button>';
1033 $content[] = '</div>';
1034
1035 $content = implode( '', $content );
1036
1037 echo $content;
1038 }
1039 }
1040
1041 // Black Friday banner
1042 public static function ays_chart_black_friday_message($ishmar){
1043 if($ishmar == 0 ){
1044 $content = array();
1045
1046 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1047 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1048 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1049 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1050 $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>';
1051 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1052 $content[] = '</div>';
1053
1054 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1055 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1056 $content[] = '</div>';
1057
1058 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1059 $content[] = '<div id="ays-chart-countdown-main-container">';
1060 $content[] = '<div class="ays-chart-countdown-container">';
1061 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1062 $content[] = '<ul>';
1063 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1064 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1065 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1066 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1067 $content[] = '</ul>';
1068 $content[] = '</div>';
1069 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1070 $content[] = '<span>🚀</span>';
1071 $content[] = '<span>⌛</span>';
1072 $content[] = '<span>🔥</span>';
1073 $content[] = '<span>💣</span>';
1074 $content[] = '</div>';
1075 $content[] = '</div>';
1076 $content[] = '</div>';
1077 $content[] = '</div>';
1078
1079 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1080 $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>';
1081 $content[] = '</div>';
1082 $content[] = '</div>';
1083 $content[] = '</div>';
1084
1085 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1086 $content[] = '<form method="POST">';
1087 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1088 if( current_user_can( 'manage_options' ) ){
1089 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1090 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1091 }
1092 $content[] = '</div>';
1093 $content[] = '</form>';
1094 $content[] = '</div>';
1095 $content[] = '</div>';
1096
1097 $content = implode( '', $content );
1098
1099 echo $content;
1100 }
1101 }
1102
1103 // Christmas banner
1104 public static function ays_chart_christmas_message($ishmar){
1105 if($ishmar == 0 ){
1106 $content = array();
1107
1108 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1109 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1110 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1111 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1112 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Limited Time', CHART_BUILDER_NAME ) .' '. '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-sale" target="_blank">' . __( '40%', CHART_BUILDER_NAME ) . '</a>' . ' SALE</div>';
1113 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', CHART_BUILDER_NAME ) . '</div>';
1114 $content[] = '</div>';
1115
1116 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1117 $content[] = '<div id="ays-chart-countdown-main-container">';
1118 $content[] = '<div class="ays-chart-countdown-container">';
1119 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1120 $content[] = '<ul>';
1121 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', CHART_BUILDER_NAME ) . '</li>';
1122 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', CHART_BUILDER_NAME ) . '</li>';
1123 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', CHART_BUILDER_NAME ) . '</li>';
1124 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', CHART_BUILDER_NAME ) . '</li>';
1125 $content[] = '</ul>';
1126 $content[] = '</div>';
1127 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1128 $content[] = '<span>🚀</span>';
1129 $content[] = '<span>⌛</span>';
1130 $content[] = '<span>🔥</span>';
1131 $content[] = '<span>💣</span>';
1132 $content[] = '</div>';
1133 $content[] = '</div>';
1134 $content[] = '</div>';
1135 $content[] = '</div>';
1136
1137 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1138 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW!', CHART_BUILDER_NAME ) . '</a>';
1139 $content[] = '</div>';
1140 $content[] = '</div>';
1141 $content[] = '</div>';
1142
1143 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1144 $content[] = '<form method="POST">';
1145 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1146 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', CHART_BUILDER_NAME ) . '</button>';
1147 $content[] = '</div>';
1148 $content[] = '</form>';
1149 $content[] = '</div>';
1150 $content[] = '</div>';
1151
1152 $content = implode( '', $content );
1153
1154 echo $content;
1155 }
1156 }
1157
1158 // Silver Bundle
1159 public function ays_chart_silver_bundle_message($ishmar){
1160 if($ishmar == 0 ){
1161 $content = array();
1162
1163 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1164 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1165 $content[] = '<a href="https://ays-pro.com/silver-bundle" target="_blank" class="ays-chart-sale-banner-link"><img src="' . CHART_BUILDER_ADMIN_URL . '/images/silver_bundle_logo_box.png"></a>';
1166
1167 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1168
1169 $content[] = '<strong style="font-weight: bold;">';
1170 $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_NAME );
1171 $content[] = '</strong>';
1172
1173 $content[] = '<br>';
1174
1175 $content[] = '<strong>';
1176 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", CHART_BUILDER_NAME );
1177 $content[] = '</strong>';
1178
1179 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1180
1181 $content[] = '<form method="POST">';
1182 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1183 $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>';
1184 $content[] = '</div>';
1185 $content[] = '</form>';
1186
1187 $content[] = '</div>';
1188
1189 $content[] = '</div>';
1190
1191 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1192
1193 $content[] = '<div id="ays-chart-countdown-main-container">';
1194 $content[] = '<div class="ays-chart-countdown-container">';
1195
1196 $content[] = '<div id="ays-chart-countdown">';
1197 $content[] = '<ul>';
1198 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1199 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1200 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1201 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1202 $content[] = '</ul>';
1203 $content[] = '</div>';
1204
1205 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1206 $content[] = '<span>🚀</span>';
1207 $content[] = '<span>⌛</span>';
1208 $content[] = '<span>🔥</span>';
1209 $content[] = '<span>💣</span>';
1210 $content[] = '</div>';
1211
1212 $content[] = '</div>';
1213 $content[] = '</div>';
1214
1215 $content[] = '</div>';
1216
1217 $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_NAME ) . '</a>';
1218 $content[] = '</div>';
1219 $content[] = '</div>';
1220
1221 $content = implode( '', $content );
1222 echo $content;
1223 }
1224 }
1225
1226 // Black Friday 2024
1227 public function ays_chart_black_friday_message_2024($ishmar){
1228 if($ishmar == 0 ){
1229 $content = array();
1230
1231 $content[] = '<div id="ays-chart-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1232 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1233
1234 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1235
1236 $content[] = '<div id="ays-chart-countdown-main-container">';
1237 $content[] = '<div class="ays-chart-countdown-container">';
1238
1239 $content[] = '<div id="ays-chart-countdown">';
1240
1241 $content[] = '<div>';
1242 $content[] = __( "Offer ends in:", CHART_BUILDER_NAME );
1243 $content[] = '</div>';
1244
1245 $content[] = '<ul>';
1246 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", CHART_BUILDER_NAME ) .'</li>';
1247 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", CHART_BUILDER_NAME ) .'</li>';
1248 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", CHART_BUILDER_NAME ) .'</li>';
1249 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", CHART_BUILDER_NAME ) .'</li>';
1250 $content[] = '</ul>';
1251 $content[] = '</div>';
1252
1253 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1254 $content[] = '<span></span>';
1255 $content[] = '<span></span>';
1256 $content[] = '<span></span>';
1257 $content[] = '<span></span>';
1258 $content[] = '</div>';
1259
1260 $content[] = '</div>';
1261 $content[] = '</div>';
1262
1263 $content[] = '</div>';
1264
1265 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1266 $content[] = '<div>';
1267
1268 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1269 $content[] = __( "<span><a href='https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-sale-banner' class='ays-chart-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", CHART_BUILDER_NAME );
1270 $content[] = '</span>';
1271
1272 $content[] = '</br>';
1273
1274 $content[] = '<span class="ays-chart-black-friday-bundle-desc">';
1275 $content[] = '<a class="ays-chart-black-friday-bundle-desc" href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-sale-banner" class="ays-chart-black-friday-bundle-title-link" target="_blank">';
1276 $content[] = __( "20% OFF", CHART_BUILDER_NAME );
1277 $content[] = '</a>';
1278 $content[] = '</span>';
1279 $content[] = '</div>';
1280
1281 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1282
1283 $content[] = '<form action="" method="POST">';
1284 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1285 if( current_user_can( 'manage_options' ) ){
1286 $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_NAME ) .'</button>';
1287 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1288 }
1289 $content[] = '</div>';
1290 $content[] = '</form>';
1291
1292 $content[] = '</div>';
1293
1294 $content[] = '</div>';
1295
1296 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-black-friday-bundle-coupon-text-box">';
1297 $content[] = '<div class="ays-chart-black-friday-bundle-coupon-row">';
1298 $content[] = 'bfdeal20off';
1299 $content[] = '</div>';
1300
1301 $content[] = '<div class="ays-chart-black-friday-bundle-text-row">';
1302 $content[] = __( '20% Extra Discount Coupon', CHART_BUILDER_NAME );
1303 $content[] = '</div>';
1304 $content[] = '</div>';
1305
1306 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1307 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', CHART_BUILDER_NAME ) . '</a>';
1308 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1309 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
1310 $content[] = '</span>';
1311 $content[] = '</div>';
1312 $content[] = '</div>';
1313 $content[] = '</div>';
1314
1315 $content = implode( '', $content );
1316 echo $content;
1317 }
1318 }
1319
1320
1321 public function ays_chart_update_banner_time(){
1322
1323 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1324 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1325 $next_3_days = date('M d, Y H:i:s', $date);
1326
1327 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1328
1329 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1330 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1331 }
1332
1333 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1334
1335 $val = 60*60*24*0.5; // half day
1336 // $val = 60; // for testing | 1 min
1337
1338 $current_date = current_time( 'mysql' );
1339 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1340
1341 $days_diff = $date_diff / $val;
1342 if(intval($days_diff) > 0 ){
1343 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1344 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1345 }
1346
1347 return $get_ays_chart_banner_time;
1348 }
1349
1350 public function author_user_search() {
1351 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1352 $params = $_REQUEST['params'];
1353 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1354 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1355 $args = 'search=';
1356 if ($search !== null) {
1357 $args .= '*';
1358 $args .= $search;
1359 $args .= '*';
1360 }
1361
1362 $users = get_users($args);
1363
1364 $content_text = array(
1365 'results' => array()
1366 );
1367
1368 foreach ($users as $key => $value) {
1369 if ($checked !== null) {
1370 if ( !is_array( $checked ) ) {
1371 $checked2 = $checked;
1372 $checked = array();
1373 $checked[] = absint($checked2);
1374 }
1375 if (in_array($value->ID, $checked)) {
1376 continue;
1377 } else {
1378 $content_text['results'][] = array(
1379 'id' => $value->ID,
1380 'text' => $value->data->display_name,
1381 );
1382 }
1383 } else {
1384 $content_text['results'][] = array(
1385 'id' => $value->ID,
1386 'text' => $value->data->display_name,
1387 );
1388 }
1389 }
1390
1391 ob_end_clean();
1392 echo json_encode($content_text);
1393 wp_die();
1394 }
1395
1396 /**
1397 * Determine if the plugin/addon installations are allowed.
1398 *
1399 * @since 6.4.0.4
1400 *
1401 * @param string $type Should be `plugin` or `addon`.
1402 *
1403 * @return bool
1404 */
1405 public static function ays_chart_can_install( $type ) {
1406
1407 return self::ays_chart_can_do( 'install', $type );
1408 }
1409
1410 /**
1411 * Determine if the plugin/addon activations are allowed.
1412 *
1413 * @since 6.4.0.4
1414 *
1415 * @param string $type Should be `plugin` or `addon`.
1416 *
1417 * @return bool
1418 */
1419 public static function ays_chart_can_activate( $type ) {
1420
1421 return self::ays_chart_can_do( 'activate', $type );
1422 }
1423
1424 /**
1425 * Determine if the plugin/addon installations/activations are allowed.
1426 *
1427 * @since 6.4.0.4
1428 *
1429 * @param string $what Should be 'activate' or 'install'.
1430 * @param string $type Should be `plugin` or `addon`.
1431 *
1432 * @return bool
1433 */
1434 public static function ays_chart_can_do( $what, $type ) {
1435
1436 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1437 return false;
1438 }
1439
1440 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1441 return false;
1442 }
1443
1444 $capability = $what . '_plugins';
1445
1446 if ( ! current_user_can( $capability ) ) {
1447 return false;
1448 }
1449
1450 // Determine whether file modifications are allowed and it is activation permissions checking.
1451 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1452 return false;
1453 }
1454
1455 // All plugin checks are done.
1456 if ( $type === 'plugin' ) {
1457 return true;
1458 }
1459 return false;
1460 }
1461
1462 /**
1463 * Activate plugin.
1464 *
1465 * @since 1.0.0
1466 * @since 6.4.0.4 Updated the permissions checking.
1467 */
1468 public function ays_chart_activate_plugin() {
1469
1470 // Run a security check.
1471 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1472
1473 // Check for permissions.
1474 if ( ! current_user_can( 'activate_plugins' ) ) {
1475 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1476 }
1477
1478 $type = 'addon';
1479
1480 if ( isset( $_POST['plugin'] ) ) {
1481
1482 if ( ! empty( $_POST['type'] ) ) {
1483 $type = sanitize_key( $_POST['type'] );
1484 }
1485
1486 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1487 $activate = activate_plugins( $plugin );
1488
1489 if ( ! is_wp_error( $activate ) ) {
1490 if ( $type === 'plugin' ) {
1491 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1492 } else {
1493 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1494 }
1495 }
1496 }
1497
1498 if ( $type === 'plugin' ) {
1499 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1500 }
1501
1502 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1503 }
1504
1505 /**
1506 * Install addon.
1507 *
1508 * @since 1.0.0
1509 * @since 6.4.0.4 Updated the permissions checking.
1510 */
1511 public function ays_chart_install_plugin() {
1512
1513 // Run a security check.
1514 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1515
1516 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1517 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1518
1519 // Check if new installations are allowed.
1520 if ( ! self::ays_chart_can_install( $type ) ) {
1521 wp_send_json_error( $generic_error );
1522 }
1523
1524 $error = $type === 'plugin'
1525 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1526 : "";
1527
1528 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1529
1530 if ( empty( $plugin_url ) ) {
1531 wp_send_json_error( $error );
1532 }
1533
1534 // Prepare variables.
1535 $url = esc_url_raw(
1536 add_query_arg(
1537 [
1538 'page' => 'chart-builder-featured-plugins',
1539 ],
1540 admin_url( 'admin.php' )
1541 )
1542 );
1543
1544 ob_start();
1545 $creds = request_filesystem_credentials( $url, '', false, false, null );
1546
1547 // Hide the filesystem credentials form.
1548 ob_end_clean();
1549
1550 // Check for file system permissions.
1551 if ( $creds === false ) {
1552 wp_send_json_error( $error );
1553 }
1554
1555 if ( ! WP_Filesystem( $creds ) ) {
1556 wp_send_json_error( $error );
1557 }
1558
1559 /*
1560 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1561 */
1562 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1563 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1564 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1565
1566
1567 // Do not allow WordPress to search/download translations, as this will break JS output.
1568 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1569
1570 // Create the plugin upgrader with our custom skin.
1571 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1572
1573 // Error check.
1574 if ( ! method_exists( $installer, 'install' ) ) {
1575 wp_send_json_error( $error );
1576 }
1577
1578 $installer->install( $plugin_url );
1579
1580 // Flush the cache and return the newly installed plugin basename.
1581 wp_cache_flush();
1582
1583 $plugin_basename = $installer->plugin_info();
1584
1585 if ( empty( $plugin_basename ) ) {
1586 wp_send_json_error( $error );
1587 }
1588
1589 $result = array(
1590 'msg' => $generic_error,
1591 'is_activated' => false,
1592 'basename' => $plugin_basename,
1593 );
1594
1595 // Check for permissions.
1596 if ( ! current_user_can( 'activate_plugins' ) ) {
1597 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1598
1599 wp_send_json_success( $result );
1600 }
1601
1602 // Activate the plugin silently.
1603 $activated = activate_plugin( $plugin_basename );
1604 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1605
1606 if ( ! is_wp_error( $activated ) ) {
1607
1608 $result['is_activated'] = true;
1609 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1610
1611 wp_send_json_success( $result );
1612 }
1613
1614 // Fallback error just in case.
1615 wp_send_json_error( $result );
1616 }
1617
1618 /**
1619 * List of AM plugins that we propose to install.
1620 *
1621 * @since 6.4.0.4
1622 *
1623 * @return array
1624 */
1625 protected function get_am_plugins() {
1626 if ( !isset( $_SESSION ) ) {
1627 session_start();
1628 }
1629
1630 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1631
1632 $plugin_slug = array(
1633 'quiz-maker',
1634 'survey-maker',
1635 'poll-maker',
1636 'ays-popup-box',
1637 'secure-copy-content-protection',
1638 'gallery-photo-gallery',
1639 'ays-chatgpt-assistant',
1640 'easy-form',
1641 );
1642
1643 $plugin_url_arr = array();
1644 foreach ($plugin_slug as $key => $slug) {
1645 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1646 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1647 $plugin_url = (isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && $_SESSION['ays_chart_our_product_links'][$slug] != "") ? esc_url( $_SESSION['ays_chart_our_product_links'][$slug] ) : "";
1648 } else {
1649 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1650 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1651 if ( $latest_version != '' ) {
1652 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1653 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1654 }
1655 }
1656
1657 $plugin_url_arr[$slug] = $plugin_url;
1658 }
1659
1660 $plugins_array = array(
1661 'quiz-maker/quiz-maker.php' => array(
1662 'icon' => $images_url . 'icon-quiz-128x128.png',
1663 'name' => __( 'Quiz Maker', "easy-form" ),
1664 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', "easy-form" ),
1665 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', "easy-form" ),
1666 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1667 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1668 'url' => $plugin_url_arr['quiz-maker'],
1669 ),
1670 'survey-maker/survey-maker.php' => array(
1671 'icon' => $images_url . 'icon-survey-128x128.png',
1672 'name' => __( 'Survey Maker', 'chart-builder' ),
1673 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1674 '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' ),
1675 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1676 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1677 'url' => $plugin_url_arr['survey-maker'],
1678 ),
1679 'poll-maker/poll-maker-ays.php' => array(
1680 'icon' => $images_url . 'icon-poll-128x128.png',
1681 'name' => __( 'Poll Maker', 'chart-builder' ),
1682 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1683 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1684 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1685 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1686 'url' => $plugin_url_arr['poll-maker'],
1687 ),
1688 'ays-popup-box/ays-pb.php' => array(
1689 'icon' => $images_url . 'icon-popup-128x128.png',
1690 'name' => __( 'Popup Box', 'chart-builder' ),
1691 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1692 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1693 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1694 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1695 'url' => $plugin_url_arr['ays-popup-box'],
1696 ),
1697 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1698 'icon' => $images_url . 'icon-sccp-128x128.png',
1699 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1700 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1701 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1702 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1703 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1704 'url' => $plugin_url_arr['secure-copy-content-protection'],
1705 ),
1706 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1707 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1708 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1709 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1710 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1711 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1712 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1713 'url' => $plugin_url_arr['gallery-photo-gallery'],
1714 ),
1715 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1716 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1717 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1718 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
1719 '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' ),
1720 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
1721 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
1722 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
1723 ),
1724 'easy-form/easy-form.php' => array(
1725 'icon' => $images_url . 'icon-form-128x128.png',
1726 'name' => __( 'Easy Form', 'chart-builder' ),
1727 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
1728 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
1729 'wporg' => 'https://wordpress.org/plugins/easy-form/',
1730 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
1731 'url' => $plugin_url_arr['easy-form'],
1732 ),
1733 );
1734
1735 return $plugins_array;
1736 }
1737
1738 protected function ays_chart_get_latest_plugin_version( $slug ){
1739
1740 if ( is_null( $slug ) || empty($slug) ) {
1741 return "";
1742 }
1743
1744 $version_latest = "";
1745
1746 if ( ! function_exists( 'plugins_api' ) ) {
1747 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
1748 }
1749
1750 // set the arguments to get latest info from repository via API ##
1751 $args = array(
1752 'slug' => $slug,
1753 'fields' => array(
1754 'version' => true,
1755 )
1756 );
1757
1758 /** Prepare our query */
1759 $call_api = plugins_api( 'plugin_information', $args );
1760
1761 /** Check for Errors & Display the results */
1762 if ( is_wp_error( $call_api ) ) {
1763 $api_error = $call_api->get_error_message();
1764 } else {
1765
1766 //echo $call_api; // everything ##
1767 if ( ! empty( $call_api->version ) ) {
1768 $version_latest = $call_api->version;
1769 }
1770 }
1771
1772 return $version_latest;
1773 }
1774
1775 /**
1776 * Get AM plugin data to display in the Addons section of About tab.
1777 *
1778 * @since 6.4.0.4
1779 *
1780 * @param string $plugin Plugin slug.
1781 * @param array $details Plugin details.
1782 * @param array $all_plugins List of all plugins.
1783 *
1784 * @return array
1785 */
1786 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
1787
1788 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
1789 $show_pro = false;
1790
1791 $plugin_data = array();
1792
1793 if ( $have_pro ) {
1794 if ( array_key_exists( $plugin, $all_plugins ) ) {
1795 if ( is_plugin_active( $plugin ) ) {
1796 $show_pro = true;
1797 }
1798 }
1799 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
1800 $show_pro = true;
1801 }
1802 if ( $show_pro ) {
1803 $plugin = $details['pro']['plug'];
1804 $details = $details['pro'];
1805 }
1806 }
1807
1808 if ( array_key_exists( $plugin, $all_plugins ) ) {
1809 if ( is_plugin_active( $plugin ) ) {
1810 // Status text/status.
1811 $plugin_data['status_class'] = 'status-active';
1812 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
1813 // Button text/status.
1814 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
1815 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
1816 $plugin_data['plugin_src'] = esc_attr( $plugin );
1817 } else {
1818 // Status text/status.
1819 $plugin_data['status_class'] = 'status-installed';
1820 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
1821 // Button text/status.
1822 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1823 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
1824 $plugin_data['plugin_src'] = esc_attr( $plugin );
1825 }
1826 } else {
1827 // Doesn't exist, install.
1828 // Status text/status.
1829 $plugin_data['status_class'] = 'status-missing';
1830
1831 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
1832 $plugin_data['status_class'] = 'status-go-to-url';
1833 }
1834 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
1835 // Button text/status.
1836 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1837 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
1838 $plugin_data['plugin_src'] = esc_url( $details['url'] );
1839 }
1840
1841 $plugin_data['details'] = $details;
1842
1843 return $plugin_data;
1844 }
1845
1846 /**
1847 * Display the Addons section of About tab.
1848 *
1849 * @since 6.4.0.4
1850 */
1851 public function output_about_addons() {
1852
1853 if ( ! function_exists( 'get_plugins' ) ) {
1854 require_once ABSPATH . 'wp-admin/includes/plugin.php';
1855 }
1856
1857 $all_plugins = get_plugins();
1858 $am_plugins = $this->get_am_plugins();
1859 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
1860 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
1861
1862 $content = '';
1863 $content.= '<div class="ays-chart-cards-block">';
1864 foreach ( $am_plugins as $plugin => $details ){
1865
1866 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
1867 $plugin_ready_to_activate = $can_activate_plugins
1868 && isset( $plugin_data['status_class'] )
1869 && $plugin_data['status_class'] === 'status-installed';
1870 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
1871 || $plugin_data['status_class'] !== 'status-active';
1872
1873 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
1874
1875 $plugin_action_class_disbaled = "";
1876 if ( strpos($plugin_action_class, 'status-active') !== false ) {
1877 $plugin_action_class_disbaled = "disbaled='true'";
1878 }
1879
1880 $content .= '
1881 <div class="ays-chart-card">
1882 <div class="ays-chart-card__content flexible">
1883 <div class="ays-chart-card__content-img-box">
1884 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
1885 </div>
1886 <div class="ays-chart-card__text-block">
1887 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
1888 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
1889 <span class="ays-chart-card__text-hidden">
1890 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
1891 </span>
1892 </p>
1893 </div>
1894 </div>
1895 <div class="ays-chart-card__footer">';
1896 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
1897 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
1898 '. wp_kses_post( $plugin_data['action_text'] ) .'
1899 </button>';
1900 }
1901 elseif ( $plugin_not_activated ) {
1902 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
1903 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
1904 <span aria-hidden="true" class="dashicons dashicons-external"></span>
1905 </a>';
1906 }
1907 $content .='
1908 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', $this->plugin_name) .'</a>
1909 </div>
1910 </div>';
1911 }
1912 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
1913 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
1914 $content.= '</div>';
1915
1916 echo $content;
1917 }
1918
1919 /**
1920 * Returns the data from Quiz maker.
1921 *
1922 * @access public
1923 */
1924 public function fetch_quiz_maker_data(){
1925 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
1926
1927 $params = $_POST['params'];
1928 if ( !isset($params) || empty($params) ) {
1929 return array(
1930 'success' => false,
1931 'data' => array(
1932 'msg' => __( "Something went wrong.", "chart-builder" )
1933 )
1934 );
1935 }
1936
1937 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
1938 if ( $query == '' ) {
1939 return array(
1940 'success' => false,
1941 'data' => array(
1942 'msg' => __( "No data given.", "chart-builder" )
1943 )
1944 );
1945 }
1946 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
1947 $user_id = get_current_user_id();
1948
1949 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
1950
1951 if (empty($return_results)) {
1952 return array(
1953 'success' => false,
1954 'data' => array(
1955 'msg' => __( "Something went wrong.", "chart-builder" )
1956 )
1957 );
1958 }
1959
1960 $result_values = $return_results['result'];
1961 $query = $return_results['query'];
1962
1963 if (empty($result_values)) {
1964 return array(
1965 'success' => false,
1966 'data' => array(
1967 'msg' => $return_results['message']
1968 )
1969 );
1970 }
1971
1972 if (count($return_results['result'][0]) != 1 ) {
1973 $results = array();
1974 $headers = array();
1975 if ( $result_values ) {
1976 $row_num = 0;
1977 foreach ( $result_values as $row ) {
1978 $result = array();
1979 foreach ( $row as $k => $v ) {
1980 $result[] = $v;
1981 if ( $row_num === 0 ) {
1982 $headers[] = $k;
1983 }
1984 }
1985 $results[] = $result;
1986 $row_num++;
1987 }
1988 }
1989 } else if (count($return_results['result'][0]) == 1) {
1990 $results = array();
1991 $headers = array();
1992 if ( $result_values ) {
1993 $row_num = 0;
1994 foreach ( $result_values as $index => $row ) {
1995 $result = array();
1996 foreach ( $row as $k => $v ) {
1997 $result[] = strval($index) + 1;
1998 $result[] = $v;
1999 if ( $row_num === 0 ) {
2000 $headers[] = 'Quiz';
2001 $headers[] = $k;
2002 }
2003 }
2004 $results[] = $result;
2005 $row_num++;
2006 }
2007 }
2008 }
2009
2010 if (empty($results)) {
2011 return array(
2012 'success' => false,
2013 'data' => array(
2014 'msg' => $return_results['message']
2015 )
2016 );
2017 }
2018
2019 foreach ($results as $key => $value) {
2020 if (!isset($value) || count($value) <= 1 && $key != 0) {
2021 unset($results[$key]);
2022 }
2023 }
2024
2025 array_unshift($results, $headers);
2026 $results = array_values( $results );
2027 $data = $results;
2028
2029 $headers = $results[0];
2030 unset( $results[0] );
2031
2032 $html = CBFunctions()->get_table_html( $headers, $results );
2033
2034 return array(
2035 'success' => true,
2036 'data' => array(
2037 'table' => $html,
2038 'data' => $data
2039 )
2040 );
2041 }
2042
2043 /**
2044 * Saves the Quiz maker data.
2045 *
2046 * @access public
2047 */
2048 public function save_quiz_maker_data() {
2049 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2050
2051 $params = $_POST['params'];
2052 if ( !isset($params) || empty($params) ) {
2053 return array(
2054 'success' => false,
2055 'data' => array(
2056 'msg' => __( "Something went wrong.", "chart-builder" )
2057 )
2058 );
2059 }
2060
2061 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2062 if ( $query_id == '' ) {
2063 return array(
2064 'success' => false,
2065 'data' => array(
2066 'msg' => __( "No data given.", "chart-builder" )
2067 )
2068 );
2069 }
2070
2071 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2072 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2073 $user_id = get_current_user_id();
2074
2075 if ( $chart_id >= 0 ) {
2076
2077 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2078
2079 if (empty($return_results)) {
2080 return array(
2081 'success' => false,
2082 'data' => array(
2083 'msg' => __( "Something went wrong.", "chart-builder" )
2084 )
2085 );
2086 }
2087
2088 $result_values = $return_results['result'];
2089 $query = $return_results['query'];
2090
2091 if (empty($result_values)) {
2092 return array(
2093 'success' => false,
2094 'data' => array(
2095 'msg' => $return_results['message']
2096 )
2097 );
2098 }
2099
2100 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2101 $results = array();
2102 $headers = array();
2103 if ( $result_values ) {
2104 $row_num = 0;
2105 foreach ( $result_values as $row ) {
2106 $result = array();
2107 foreach ( $row as $k => $v ) {
2108 $result[] = $v;
2109 if ( $row_num === 0 ) {
2110 $headers[] = $k;
2111 }
2112 }
2113 $results[] = $result;
2114 $row_num++;
2115 }
2116 }
2117 } else if (count($return_results['result'][0]) == 1) {
2118 $results = array();
2119 $headers = array();
2120 if ( $result_values ) {
2121 $row_num = 0;
2122 foreach ( $result_values as $index => $row ) {
2123 $result = array();
2124 foreach ( $row as $k => $v ) {
2125 $result[] = strval($index) + 1;
2126 $result[] = $v;
2127 if ( $row_num === 0 ) {
2128 $headers[] = 'Quiz';
2129 $headers[] = $k;
2130 }
2131 }
2132 $results[] = $result;
2133 $row_num++;
2134 }
2135 }
2136 }
2137
2138 $source_type = 'quiz_maker';
2139 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2140 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2141
2142 update_option( $option_name_for_data, array(
2143 'source_type' => $source_type,
2144 'source' => $query,
2145 'data' => $results,
2146 ) );
2147 update_option( $option_name_for_quiz, array(
2148 'quiz_query' => $query_id,
2149 'quiz_id' => $quiz_id
2150 ) );
2151
2152 } else {
2153 return array(
2154 'success' => false,
2155 'data' => array(
2156 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2157 )
2158 );
2159 }
2160
2161 return array(
2162 'success' => true,
2163 'data' => array(
2164 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2165 )
2166 );
2167 }
2168
2169 /**
2170 * Chart page action hooks
2171 */
2172
2173 /**
2174 * Chart page sources contents
2175 * @param $args
2176 */
2177 public function ays_chart_page_source_contents( $args ){
2178 $chart_source_type = $args['chart_source_type'];
2179
2180 if ($chart_source_type === 'chart-js') {
2181 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2182 } else {
2183 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2184 }
2185
2186 $source_type = $args['source_type'];
2187
2188 $sources = array();
2189 foreach ( $sources_contents as $key => $sources_content ) {
2190 $collapsed = $key == $source_type ? 'false' : 'true';
2191
2192 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2193 if( isset( $sources_content['title'] ) ){
2194 $content .= '<legend class="ays-accordion-options-header">';
2195 $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">
2196 <g>
2197 <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" />
2198 </g>
2199 </svg>';
2200
2201 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2202 }
2203
2204 $content .= '<div class="ays-accordion-options-content">';
2205 $content .= $sources_content['content'];
2206 $content .= '</div>';
2207
2208 $content .= '</fieldset>';
2209
2210 $sources[] = $content;
2211 }
2212 $content_for_escape = implode('' , $sources );
2213 echo html_entity_decode(esc_html( $content_for_escape ));
2214 }
2215
2216 public function source_contents_import_from_csv_settings( $sources, $args ){
2217 $html_class_prefix = $args['html_class_prefix'];
2218 $html_name_prefix = $args['html_name_prefix'];
2219
2220 ob_start();
2221 ?>
2222 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2223 <div class="ays-pro-features-v2-big-buttons-box">
2224 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2225 <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>
2226 <div class="ays-pro-features-v2-video-text">
2227 <?php echo __("Watch Video" , "chart-builder"); ?>
2228 </div>
2229 </a>
2230 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2231 <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>
2232 <div class="ays-pro-features-v2-upgrade-text">
2233 <?php echo __("Upgrade" , "chart-builder"); ?>
2234 </div>
2235 </a>
2236 </div>
2237 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2238 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2239 <h6><?php echo __("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2240 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2241 <option value="csv">CSV File</option>
2242 </select>
2243 <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 __("Choose the format of the file you are going to import.", "chart-builder"); ?></span>
2244 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2245 <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>
2246 </p>
2247 <div>
2248 <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" />
2249 </div>
2250 <div class='ays-chart-file-import-success'></div>
2251 <div class='ays-chart-file-import-error'></div>
2252 <div class="ays-chart-buttons-group">
2253 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2254 <?php echo __( 'Show Results', "chart-builder" ); ?>
2255 </button>
2256 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2257 <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>
2258 <?php echo __( 'Preview', "chart-builder" ); ?>
2259 </button>
2260 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2261 <?php echo __( 'Save data', "chart-builder" ); ?>
2262 </button>
2263 </div>
2264 </div>
2265 </div>
2266 </div>
2267 <?php
2268 $content = ob_get_clean();
2269
2270 $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") . '">
2271 <i class="ays_fa ays_fa_info_circle"></i>
2272 </a>';
2273
2274 $sources['file_import'] = array(
2275 'content' => $content,
2276 'title' => $title
2277 );
2278
2279 return $sources;
2280 }
2281
2282 public function source_contents_import_from_db_settings( $sources, $args ){
2283 $html_class_prefix = $args['html_class_prefix'];
2284 $html_name_prefix = $args['html_name_prefix'];
2285
2286 ob_start();
2287 ?>
2288 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2289 <div class="ays-pro-features-v2-big-buttons-box">
2290 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2291 <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>
2292 <div class="ays-pro-features-v2-video-text">
2293 <?php echo __("Watch Video" , "chart-builder"); ?>
2294 </div>
2295 </a>
2296 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2297 <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>
2298 <div class="ays-pro-features-v2-upgrade-text">
2299 <?php echo __("Upgrade" , "chart-builder"); ?>
2300 </div>
2301 </a>
2302 </div>
2303 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2304 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2305 <div id="ays-chart-db-query">
2306 <div class="<?= $html_class_prefix ?>-db-query-form">
2307 <div id="db-query-form">
2308 <input type="hidden" name="chart_id" value="1">
2309 <textarea name="query" class="<?= $html_class_prefix ?>db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2310 <div class='db-wizard-success'></div>
2311 <div class='db-wizard-error'></div>
2312 </div>
2313 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2314 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2315 <?php echo __( 'Show Results', "chart-builder" ); ?>
2316 </button>
2317 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2318 <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>
2319 <?php echo __( 'Preview', "chart-builder" ); ?>
2320 </button>
2321 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2322 <?php echo __( 'Save data', "chart-builder" ); ?>
2323 </button>
2324 </div>
2325 </div>
2326 <div class="db-wizard-hints">
2327 <ul>
2328 <!-- <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> -->
2329 <li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', $this->plugin_name ), '<span class="ays-chart-emboss">', '</span>' ); ?></li>
2330 </ul>
2331 </div>
2332 </div>
2333 </div>
2334 </div>
2335 </div>
2336 <?php
2337 $content = ob_get_clean();
2338
2339 $title = __( 'Connect to Database', $this->plugin_name ) . ' <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.",$this->plugin_name) . '">
2340 <i class="ays_fa ays_fa_info_circle"></i>
2341 </a>';
2342
2343 $sources['import_from_db'] = array(
2344 'content' => $content,
2345 'title' => $title
2346 );
2347
2348 return $sources;
2349 }
2350
2351 public function source_contents_import_from_external_db_settings( $sources, $args ){
2352 $html_class_prefix = $args['html_class_prefix'];
2353 $html_name_prefix = $args['html_name_prefix'];
2354
2355 ob_start();
2356 ?>
2357 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2358 <div class="ays-pro-features-v2-big-buttons-box">
2359 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2360 <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>
2361 <div class="ays-pro-features-v2-upgrade-text">
2362 <?php echo __("Upgrade" , "chart-builder"); ?>
2363 </div>
2364 </a>
2365 </div>
2366 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2367 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2368 <div class="form-group row mb-2">
2369 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2370 <label class="form-label">
2371 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2372 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2373 <i class="ays_fa ays_fa_info_circle"></i>
2374 </a>
2375 </label>
2376 </div>
2377 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2378 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2379 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2380 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2381 </label>
2382 </div>
2383 </div>
2384 <div id="ays-chart-external-db-query">
2385 <div class="<?= $html_class_prefix ?>-db-query-form">
2386 <div id="external-db-query-form">
2387 <input type="hidden" name="chart_id" value="1">
2388 <textarea name="query" class="<?= $html_class_prefix ?>external-db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2389 <div class='db-wizard-success'></div>
2390 <div class='db-wizard-error'></div>
2391 </div>
2392 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2393 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2394 <?php echo __( 'Show Results', "chart-builder" ); ?>
2395 </button>
2396 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2397 <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>
2398 <?php echo __( 'Preview', "chart-builder" ); ?>
2399 </button>
2400 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2401 <?php echo __( 'Save data', "chart-builder" ); ?>
2402 </button>
2403 </div>
2404 </div>
2405 <div class="db-wizard-hints">
2406 <ul>
2407 <!-- <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> -->
2408 <li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', $this->plugin_name ), '<span class="ays-chart-emboss">', '</span>' ); ?></li>
2409 </ul>
2410 </div>
2411 </div>
2412 </div>
2413 </div>
2414 </div>
2415 <?php
2416 $content = ob_get_clean();
2417
2418 $title = __( 'Connect to External Database', $this->plugin_name ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Insert the Database query and fetch data from an external database.", $this->plugin_name) . '">
2419 <i class="ays_fa ays_fa_info_circle"></i>
2420 </a>';
2421
2422 $sources['import_from_external_db'] = array(
2423 'content' => $content,
2424 'title' => $title
2425 );
2426
2427 return $sources;
2428 }
2429
2430 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2431 global $wpdb;
2432 $chart_id = $args['chart_id'];
2433 $html_class_prefix = $args['html_class_prefix'];
2434 $html_name_prefix = $args['html_name_prefix'];
2435 $source = $args['source'];
2436 $settings = $args['settings'];
2437 $quiz_queries = $args['quiz_queries'];
2438 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2439 $quiz_id = $args['quiz_id'];
2440 $quiz_query = $args['quiz_query'];
2441
2442 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2443 // $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") . '">
2444 // <i class="ays_fa ays_fa_info_circle"></i>
2445 // </a>', '<br>', '<b>', '</b>');
2446 // $content = $this->blockquote_content_quiz;
2447 // $sources['quiz_maker'] = array(
2448 // 'content' => $content,
2449 // 'title' => $title
2450 // );
2451
2452 return $sources;
2453 }
2454
2455 $sql = "SELECT `title`, `id` FROM " . $wpdb->prefix . "aysquiz_quizes WHERE `published` = 1 AND `question_ids` <> ''";
2456 $quizes = $wpdb->get_results($sql, "ARRAY_A");
2457
2458 ob_start();
2459 ?>
2460 <div class="ays-accordion-data-main-wrap">
2461 <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">
2462 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2463 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?= $chart_id ?>">
2464 <div class="<?= $html_class_prefix ?>select-quiz-maker-data-query-container" id="<?= $html_class_prefix ?>quiz-queries">
2465 <a class="ays_help <?= $html_class_prefix ?>quiz-query-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo isset($quiz_query) ? $quiz_query_tooltips[$quiz_query] : __( 'Select a query to display quiz data.', $this->plugin_name ) ?>">
2466 <i class="ays_fa ays_fa_info_circle"></i>
2467 </a>
2468 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-data-query" name="<?= $html_name_prefix ?>quiz_query">
2469 <option value=""><?= __( "Select query", "chart-builder" ) ?></option>
2470 <?php foreach ( $quiz_queries as $id => $q):
2471 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2472 <option value="<?= $id ?>" <?= $quiz_query == $id ? 'selected' : '' ?> <?php echo 'is-pro="'.$disabled.'"'; ?>><?= $q ?></option>
2473 <?php endforeach; ?>
2474 </select>
2475 </div>
2476 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2477 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz" name="<?= $html_name_prefix ?>quiz_id">
2478 <option value="0"><?= __( "Select quiz", "chart-builder" ) ?></option>
2479 <?php foreach ( $quizes as $quiz): ?>
2480 <option value="<?= $quiz['id'] ?>" <?= $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?= $quiz['title'] ?></option>
2481 <?php endforeach; ?>
2482 </select>
2483 </div>
2484 <div id="ays-chart-quiz-maker-success"></div>
2485 <div id="ays-chart-quiz-maker-error"></div>
2486 <div class="ays-chart-buttons-group">
2487 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2488 <?php echo __( 'Show Results', "chart-builder" ); ?>
2489 </button>
2490 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2491 <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>
2492 <?php echo __( 'Preview', "chart-builder" ); ?>
2493 </button>
2494 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2495 <?php echo __( 'Save data', "chart-builder" ); ?>
2496 </button>
2497 </div>
2498 </div>
2499 <div>
2500 <a href="https://www.youtube.com/watch?v=vqx76dw6NC8" target="_blank" style="text-decoration:none;font-style:italic"><?php echo __('How to Connect Quizzes to Charts', 'chart-builder'); ?></a>
2501 </div>
2502 </div>
2503 </div>
2504 <?php
2505 $content = ob_get_clean();
2506
2507 $title = sprintf( __( 'Get Quiz Maker data', $this->plugin_name ) . ' <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.",$this->plugin_name) . '">
2508 <i class="ays_fa ays_fa_info_circle"></i>
2509 </a>', '<br>', '<b>', '</b>');
2510 $sources['quiz_maker'] = array(
2511 'content' => $content,
2512 'title' => $title
2513 );
2514
2515 return $sources;
2516 }
2517
2518 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2519 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2520 return $sources;
2521 }
2522
2523 $chart_id = $args['chart_id'];
2524 $html_class_prefix = $args['html_class_prefix'];
2525 $html_name_prefix = $args['html_name_prefix'];
2526 ob_start();
2527 ?>
2528 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2529 <div class="ays-pro-features-v2-big-buttons-box">
2530 <div class="ays-pro-features-v2-video-button"></div>
2531 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2532 <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>
2533 <div class="ays-pro-features-v2-upgrade-text">
2534 <?php echo __("Upgrade" , "chart-builder"); ?>
2535 </div>
2536 </a>
2537 </div>
2538 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2539 <div id="ays-chart-woocommerce-datas">
2540 <div class="<?= $html_class_prefix ?>woocommerce-datas-form">
2541 <div id="woocommerce-datas-form">
2542 <input type="hidden" name="chart_id" value="<?= $chart_id ?>">
2543 <div class="<?= $html_class_prefix ?>woocommerce-datas-query-container" id="<?= $html_class_prefix ?>woocommerce-datas-container-id" >
2544 <a class="ays_help <?= $html_class_prefix ?>woocommerce-datas-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo __( 'Select a query to display data.', $this->plugin_name ) ?>">
2545 <i class="ays_fa ays_fa_info_circle"></i>
2546 </a>
2547 <select class="form-select" style="max-width: none;" id="<?= $html_class_prefix ?>woocommerce-datas-select" name="<?php echo esc_attr($html_name_prefix); ?>settings[woocommerce_data_id]">
2548 <option value=""><?= __( 'Select query', $this->plugin_name ) ?></option>
2549 </select>
2550 </div>
2551 <div class='ays-chart-woocommerce-datas-success'></div>
2552 <div class='ays-chart-woocommerce-datas-error'></div>
2553 </div>
2554 <div class="ays-chart-buttons-group">
2555 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2556 <?php echo __( 'Show Results', "chart-builder" ); ?>
2557 </button>
2558 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2559 <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>
2560 <?php echo __( 'Preview', "chart-builder" ); ?>
2561 </button>
2562 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2563 <?php echo __( 'Save data', "chart-builder" ); ?>
2564 </button>
2565 </div>
2566 </div>
2567 </div>
2568 </div>
2569 </div>
2570 <?php
2571 $content = ob_get_clean();
2572
2573 $title = sprintf( __( 'Get WooCommerce data', $this->plugin_name ) . ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' . __("By using this option, you can display the WooCommerce statistics by charts.%s %sNote:%s The WooCommerce plugin must be active.",$this->plugin_name) . '">
2574 <i class="ays_fa ays_fa_info_circle"></i>
2575 </a>', '<br>', '<b>', '</b>');
2576 $sources['woocommerce'] = array(
2577 'content' => $content,
2578 'title' => $title
2579 );
2580
2581 return $sources;
2582 }
2583
2584 public function source_contents_manual_settings( $sources, $args ){
2585 $html_class_prefix = $args['html_class_prefix'];
2586 $html_name_prefix = $args['html_name_prefix'];
2587 $source = $args['source'];
2588 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2589 $settings = $args['settings'];
2590 $source_chart_type = $args['source_chart_type'];
2591 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2592
2593 if (isset($source) && !empty($source)) {
2594 if ( !isset( $source[0] ) ) {
2595 if (count($source[1]) > 2) {
2596 $titles = array();
2597 for ($i = 0; $i < count($source[1]); $i++) {
2598 array_push($titles, __("Title", $this->plugin_name).$i);
2599 }
2600 $source[0] = $titles;
2601 } else {
2602 $source[0] = array(
2603 __("Country", $this->plugin_name),
2604 __("Population", $this->plugin_name),
2605 );
2606 }
2607
2608 ksort($source);
2609 }
2610 }
2611
2612 if ($action == 'add') {
2613 foreach ($source as $key => $row) {
2614 $source[$key] = array_slice($row, 0, 2);
2615 }
2616 } else if ($action == 'edit') {
2617 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2618 foreach ($source as $key => $row) {
2619 $source[$key] = array_slice($row, 0, 2);
2620 }
2621 }
2622 }
2623 ob_start();
2624 ?>
2625 <div class="ays-accordion-data-main-wrap">
2626 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2627 <?php if($source_chart_type != 'org_chart'): ?>
2628 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?= $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">
2629 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2630 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2631 </div> -->
2632 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2633 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2634 <?php if(!empty($source)):
2635 foreach($source as $source_id => $source_value):
2636 if(!empty($source_value) ):
2637 if ($source_id == 0): ?>
2638 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2639 <div class="ays-chart-empty-data-table-cell"></div>
2640 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2641 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2642 <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">
2643 <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;" />
2644 </svg>
2645 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2646 <input type="text" class="ays-text-input form-control <?= $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 stripslashes(esc_attr($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
2647 <?php if ($each_source_id !== 0): ?>
2648 <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">
2649 <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;" />
2650 </svg>
2651 <?php endif; ?>
2652 </div>
2653 </div>
2654 <?php endforeach; ?>
2655 </div>
2656 <?php else: ?>
2657 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2658 <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">
2659 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2660 <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;" />
2661 </svg>
2662 </div>
2663 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2664 <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">
2665 <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;" />
2666 </svg>
2667 </div>
2668 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2669 <?php if ($each_source_id == 0): ?>
2670 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2671 <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 htmlspecialchars(esc_attr($each_source_value)); ?>">
2672 </div>
2673 <?php else: ?>
2674 <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); ?>">
2675 <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 stripslashes(esc_attr($each_source_value)); ?>" step="any">
2676 </div>
2677 <?php endif; ?>
2678 <?php endforeach; ?>
2679 </div>
2680 <?php endif; ?>
2681 <?php endif; ?>
2682 <?php endforeach; ?>
2683 <?php else:?>
2684 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2685 <div style="height: 63.11px; padding: 0 15px;"></div>
2686 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2687 <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">
2688 <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;" />
2689 </svg>
2690 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2691 <input type="text" class="ays-text-input form-control <?= $html_class_prefix ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
2692 <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">
2693 <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;" />
2694 </svg>
2695 </div>
2696 </div>
2697 </div>
2698 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2699 <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">
2700 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2701 <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" />
2702 </svg>
2703 </div>
2704 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2705 <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">
2706 <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;" />
2707 </svg>
2708 </div>
2709 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2710 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2711 </div>
2712 <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">
2713 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2714 </div>
2715 </div>
2716 <?php endif; ?>
2717 </div>
2718 <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">
2719 <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">
2720 <?php echo __( 'Add column', "chart-builder" ); ?>
2721 </div>
2722 </div>
2723 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2724 <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">
2725 <?php echo __( 'Add row', "chart-builder" ); ?>
2726 </div>
2727 <br>
2728 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2729 <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>
2730 <?php echo __( 'Preview', "chart-builder" ); ?>
2731 </button>
2732 </div>
2733 <?php endif; ?>
2734 <div class="<?= $html_class_prefix ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
2735 <div class="<?= $html_class_prefix ?>chart-source-data-content-org-type">
2736 <ul id="<?= $html_class_prefix ?>chart-source-data-edit-tree-content">
2737 </ul>
2738 </div>
2739 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2740 <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>
2741 <?php echo __( 'Preview', "chart-builder" ); ?>
2742 </button>
2743 </div>
2744 </div>
2745 </div>
2746 <?php
2747 $content = ob_get_clean();
2748
2749 $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") . '">
2750 <i class="ays_fa ays_fa_info_circle"></i>
2751 </a>';
2752
2753 $sources['manual'] = array(
2754 'content' => $content,
2755 'title' => $title
2756 );
2757
2758 return $sources;
2759 }
2760
2761 public function source_contents_manual_settings_chartjs( $sources, $args ){
2762 $html_class_prefix = $args['html_class_prefix'];
2763 $html_name_prefix = $args['html_name_prefix'];
2764 $source = $args['source'];
2765 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2766 $settings = $args['settings'];
2767 $source_chart_type = $args['source_chart_type'];
2768 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2769
2770 ob_start();
2771 ?>
2772 <div class="ays-accordion-data-main-wrap">
2773 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2774 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?= $html_class_prefix ?>chart-source-data-manual">
2775 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2776 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2777 <?php if(!empty($source)):
2778 foreach($source as $source_id => $source_value):
2779 if(!empty($source_value) ):
2780 if ($source_id == 0): ?>
2781 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2782 <div class="ays-chart-empty-data-table-cell"></div>
2783 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2784 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2785 <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">
2786 <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;" />
2787 </svg>
2788 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2789 <input type="text" class="ays-text-input form-control <?= $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 stripslashes(esc_attr($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
2790 <?php if ($each_source_id !== 0): ?>
2791 <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">
2792 <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;" />
2793 </svg>
2794 <?php endif; ?>
2795 </div>
2796 </div>
2797 <?php endforeach; ?>
2798 </div>
2799 <?php else: ?>
2800 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2801 <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">
2802 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2803 <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;" />
2804 </svg>
2805 </div>
2806 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2807 <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">
2808 <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;" />
2809 </svg>
2810 </div>
2811 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2812 <?php if ($each_source_id == 0): ?>
2813 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2814 <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 htmlspecialchars(esc_attr($each_source_value)); ?>">
2815 </div>
2816 <?php else: ?>
2817 <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); ?>">
2818 <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 stripslashes(esc_attr($each_source_value)); ?>" step="any">
2819 </div>
2820 <?php endif; ?>
2821 <?php endforeach; ?>
2822 </div>
2823 <?php endif; ?>
2824 <?php endif; ?>
2825 <?php endforeach; ?>
2826 <?php else:?>
2827 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2828 <div style="height: 63.11px; padding: 0 15px;"></div>
2829 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2830 <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">
2831 <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;" />
2832 </svg>
2833 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2834 <input type="text" class="ays-text-input form-control <?= $html_class_prefix ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
2835 <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">
2836 <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;" />
2837 </svg>
2838 </div>
2839 </div>
2840 </div>
2841 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2842 <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">
2843 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2844 <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" />
2845 </svg>
2846 </div>
2847 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2848 <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">
2849 <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;" />
2850 </svg>
2851 </div>
2852 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2853 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2854 </div>
2855 <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">
2856 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2857 </div>
2858 </div>
2859 <?php endif; ?>
2860 </div>
2861 <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">
2862 <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">
2863 <?php echo __( 'Add column', "chart-builder" ); ?>
2864 </div>
2865 </div>
2866 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2867 <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">
2868 <?php echo __( 'Add row', "chart-builder" ); ?>
2869 </div>
2870 <br>
2871 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2872 <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>
2873 <?php echo __( 'Preview', "chart-builder" ); ?>
2874 </button>
2875 </div>
2876 </div>
2877 </div>
2878 <?php
2879 $content = ob_get_clean();
2880
2881 $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") . '">
2882 <i class="ays_fa ays_fa_info_circle"></i>
2883 </a>';
2884
2885 $sources['manual'] = array(
2886 'content' => $content,
2887 'title' => $title
2888 );
2889
2890 return $sources;
2891 }
2892
2893 /**
2894 * Chart page settings contents
2895 * @param $args
2896 */
2897 public function ays_chart_page_settings_contents( $args ){
2898 $chart_source_type = $args['chart_source_type'];
2899
2900 if ($chart_source_type === 'chart-js') {
2901 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
2902 } else {
2903 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
2904 }
2905
2906 $sources = array();
2907 foreach ( $sources_contents as $key => $sources_content ) {
2908 $collapsed = $key == 'general_settings' ? 'false' : 'true';
2909
2910 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
2911 if(isset($sources_content['title'])){
2912 $content .= '<legend class="ays-accordion-options-header">';
2913 $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">
2914 <g>
2915 <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" />
2916 </g>
2917 </svg>';
2918
2919 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
2920 }
2921
2922 $content .= '<div class="ays-accordion-options-content">';
2923 $content .= $sources_content['content'];
2924 $content .= '</div>';
2925
2926 $content .= '</fieldset>';
2927
2928 $sources[] = $content;
2929 }
2930 $content_for_escape = implode('' , $sources );
2931 echo html_entity_decode(esc_html( $content_for_escape ));
2932 }
2933
2934 public function settings_contents_general_settings( $sources, $args ){
2935 $html_class_prefix = $args['html_class_prefix'];
2936 $html_name_prefix = $args['html_name_prefix'];
2937 $chart_description = $args['chart_description'];
2938 $create_author_data = $args['create_author_data'];
2939 $status = $args['status'];
2940 $settings = $args['settings'];
2941
2942 $show_title = $settings['show_title'];
2943 $show_description = $settings['show_description'];
2944 $enable_interactivity = $settings['enable_interactivity'];
2945 $maximized_view = $settings['maximized_view'];
2946
2947 ob_start();
2948 ?>
2949 <div class="ays-accordion-data-main-wrap">
2950 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
2951 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2952 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2953 <label for="ays-status" class="form-label">
2954 <?php echo esc_html(__('Status', "chart-builder")); ?>
2955 <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") ); ?>">
2956 <i class="ays_fa ays_fa_info_circle"></i>
2957 </a>
2958 </label>
2959 </div>
2960 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2961 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2962 <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' : ''; ?> >
2963 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2964 </label>
2965 </div>
2966 </div> <!-- Status -->
2967 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2968 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
2969 <label for="ays-chart-description" class="form-label">
2970 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
2971 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
2972 <i class="ays_fa ays_fa_info_circle"></i>
2973 </a>
2974 </label>
2975 </div>
2976 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
2977 <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>
2978 </div>
2979 </div> <!-- Chart description -->
2980 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2981 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
2982 <label for="ays-chart-create-author" class="form-label">
2983 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
2984 <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")); ?>">
2985 <i class="ays_fa ays_fa_info_circle"></i>
2986 </a>
2987 </label>
2988 </div>
2989 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
2990 <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">
2991 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
2992 <?php if (isset($create_author_data['ID'])) : ?>
2993 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
2994 <?php endif; ?>
2995 </select>
2996 </div>
2997 </div> <!-- Change chart author -->
2998 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2999 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3000 <label for="ays-chart-show-title" class="form-label">
3001 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3002 <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") ); ?>">
3003 <i class="ays_fa ays_fa_info_circle"></i>
3004 </a>
3005 </label>
3006 </div>
3007 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3008 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3009 <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); ?> >
3010 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3011 </label>
3012 </div>
3013 </div> <!-- Show title -->
3014 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3015 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3016 <label for="ays-chart-show-description" class="form-label">
3017 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3018 <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") ); ?>">
3019 <i class="ays_fa ays_fa_info_circle"></i>
3020 </a>
3021 </label>
3022 </div>
3023 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3024 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3025 <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); ?> >
3026 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3027 </label>
3028 </div>
3029 </div> <!-- Show description -->
3030 <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">
3031 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3032 <label for="ays-chart-option-enable-interactivity" class="form-label">
3033 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3034 <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") ); ?>">
3035 <i class="ays_fa ays_fa_info_circle"></i>
3036 </a>
3037 </label>
3038 </div>
3039 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3040 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3041 <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); ?> >
3042 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3043 </label>
3044 </div>
3045 </div> <!-- Enable interactivity -->
3046 <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">
3047 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3048 <label for="ays-chart-option-maximized-view" class="form-label">
3049 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3050 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3051 <i class="ays_fa ays_fa_info_circle"></i>
3052 </a>
3053 </label>
3054 </div>
3055 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3056 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3057 <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); ?> >
3058 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3059 </label>
3060 </div>
3061 </div> <!-- Maximized view -->
3062 </div>
3063 </div>
3064 <?php
3065 $content = ob_get_clean();
3066
3067 $title = __( 'General Settings', "chart-builder" );
3068
3069 $sources['general_settings'] = array(
3070 'content' => $content,
3071 'title' => $title
3072 );
3073
3074 return $sources;
3075 }
3076
3077 public function settings_contents_general_settings_chartjs( $sources, $args ){
3078 $html_class_prefix = $args['html_class_prefix'];
3079 $html_name_prefix = $args['html_name_prefix'];
3080 $chart_description = $args['chart_description'];
3081 $create_author_data = $args['create_author_data'];
3082 $status = $args['status'];
3083 $settings = $args['settings'];
3084
3085 $show_title = $settings['show_title'];
3086 $show_description = $settings['show_description'];
3087
3088 ob_start();
3089 ?>
3090 <div class="ays-accordion-data-main-wrap">
3091 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3092 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3093 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3094 <label for="ays-status" class="form-label">
3095 <?php echo esc_html(__('Status', "chart-builder")); ?>
3096 <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") ); ?>">
3097 <i class="ays_fa ays_fa_info_circle"></i>
3098 </a>
3099 </label>
3100 </div>
3101 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3102 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3103 <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' : ''; ?> >
3104 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3105 </label>
3106 </div>
3107 </div> <!-- Status -->
3108 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3109 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3110 <label for="ays-chart-description" class="form-label">
3111 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3112 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3113 <i class="ays_fa ays_fa_info_circle"></i>
3114 </a>
3115 </label>
3116 </div>
3117 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3118 <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>
3119 </div>
3120 </div> <!-- Chart description -->
3121 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3122 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3123 <label for="ays-chart-create-author" class="form-label">
3124 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3125 <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")); ?>">
3126 <i class="ays_fa ays_fa_info_circle"></i>
3127 </a>
3128 </label>
3129 </div>
3130 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3131 <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">
3132 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3133 <?php if (isset($create_author_data['ID'])) : ?>
3134 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3135 <?php endif; ?>
3136 </select>
3137 </div>
3138 </div> <!-- Change chart author -->
3139 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3140 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3141 <label for="ays-chart-show-title" class="form-label">
3142 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3143 <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") ); ?>">
3144 <i class="ays_fa ays_fa_info_circle"></i>
3145 </a>
3146 </label>
3147 </div>
3148 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3149 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3150 <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); ?> >
3151 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3152 </label>
3153 </div>
3154 </div> <!-- Show title -->
3155 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3156 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3157 <label for="ays-chart-show-description" class="form-label">
3158 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3159 <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") ); ?>">
3160 <i class="ays_fa ays_fa_info_circle"></i>
3161 </a>
3162 </label>
3163 </div>
3164 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3165 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3166 <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); ?> >
3167 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3168 </label>
3169 </div>
3170 </div> <!-- Show description -->
3171 </div>
3172 </div>
3173 <?php
3174 $content = ob_get_clean();
3175
3176 $title = __( 'General Settings', "chart-builder" );
3177
3178 $sources['general_settings'] = array(
3179 'content' => $content,
3180 'title' => $title
3181 );
3182
3183 return $sources;
3184 }
3185
3186 public function settings_contents_tooltip_settings( $sources, $args ){
3187 $html_class_prefix = $args['html_class_prefix'];
3188 $html_name_prefix = $args['html_name_prefix'];
3189 $settings = $args['settings'];
3190
3191 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3192 $tooltip_trigger = $settings['tooltip_trigger'];
3193 $show_color_code = $settings['show_color_code'];
3194 $tooltip_italic = $settings['tooltip_italic'];
3195 $tooltip_bold = $settings['tooltip_bold'];
3196 $tooltip_bold_options = $settings['tooltip_bold_options'];
3197 $tooltip_text_color = $settings['tooltip_text_color'];
3198 $tooltip_font_size = $settings['tooltip_font_size'];
3199
3200 ob_start();
3201 ?>
3202 <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">
3203 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3204 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3205 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3206 <label for="ays-chart-option-tooltip-trigger">
3207 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3208 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3209 <i class="ays_fa ays_fa_info_circle"></i>
3210 </a>
3211 </label>
3212 </div>
3213 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3214 <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]">
3215 <?php
3216 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3217 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3218 ?>
3219 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3220 <?php
3221 endforeach;
3222 ?>
3223 </select>
3224 </div>
3225 </div> <!-- Trigger -->
3226 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3227 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3228 <label for="ays-chart-option-show-color-code">
3229 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3230 <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") ); ?>">
3231 <i class="ays_fa ays_fa_info_circle"></i>
3232 </a>
3233 </label>
3234 </div>
3235 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3236 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3237 <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); ?> >
3238 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3239 </label>
3240 </div>
3241 </div> <!-- Show Color Code -->
3242 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3243 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3244 <label for="ays-chart-option-tooltip-text-color">
3245 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3246 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3247 <i class="ays_fa ays_fa_info_circle"></i>
3248 </a>
3249 </label>
3250 </div>
3251 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3252 <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) ?>">
3253 </div>
3254 </div> <!-- Text color -->
3255 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3256 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3257 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3258 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3259 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo 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") ); ?>">
3260 <i class="ays_fa ays_fa_info_circle"></i>
3261 </a>
3262 </label>
3263 </div>
3264 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3265 <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) ?>">
3266 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3267 </div>
3268 </div> <!-- Font size -->
3269 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3270 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3271 <label for="ays-chart-option-tooltip-italic">
3272 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3273 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3274 <i class="ays_fa ays_fa_info_circle"></i>
3275 </a>
3276 </label>
3277 </div>
3278 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3279 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3280 <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); ?> >
3281 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3282 </label>
3283 </div>
3284 </div> <!-- Italic text -->
3285 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3286 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3287 <label for="ays-chart-option-tooltip-bold">
3288 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3289 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3290 <i class="ays_fa ays_fa_info_circle"></i>
3291 </a>
3292 </label>
3293 </div>
3294 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3295 <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]">
3296 <?php
3297 foreach ( $tooltip_bold_options as $option_slug => $option ):
3298 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3299 ?>
3300 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3301 <?php
3302 endforeach;
3303 ?>
3304 </select>
3305 </div>
3306 </div> <!-- Bold text -->
3307 </div>
3308 </div>
3309 <?php
3310 $content = ob_get_clean();
3311
3312 $title = __( 'Tooltip', "chart-builder" );
3313
3314 $sources['tooltip'] = array(
3315 'content' => $content,
3316 'title' => $title
3317 );
3318
3319 return $sources;
3320 }
3321
3322 public function settings_contents_legend_settings( $sources, $args ){
3323 $html_class_prefix = $args['html_class_prefix'];
3324 $html_name_prefix = $args['html_name_prefix'];
3325 $settings = $args['settings'];
3326 $legend_positions = $settings['legend_positions'];
3327 $legend_position = $settings['legend_position'];
3328 $legend_alignments = $settings['legend_alignments'];
3329 $legend_alignment = $settings['legend_alignment'];
3330 $legend_color = $settings['legend_color'];
3331 $legend_font_size = $settings['legend_font_size'];
3332 $legend_bold = $settings['legend_bold'];
3333 $legend_italic = $settings['legend_italic'];
3334
3335 ob_start();
3336 ?>
3337 <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">
3338 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3339 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3340 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3341 <label for="ays-chart-option-legend-position">
3342 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3343 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") ); ?>">
3344 <i class="ays_fa ays_fa_info_circle"></i>
3345 </a>
3346 </label>
3347 </div>
3348 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3349 <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]">
3350 <?php
3351 foreach ( $legend_positions as $option_slug => $option ):
3352 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3353
3354 $type_class = '';
3355 if ($option_slug == 'left') {
3356 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3357 } else if ($option_slug == 'in') {
3358 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3359 } else if ($option_slug == 'labeled') {
3360 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3361 }
3362
3363 ?>
3364
3365 <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>
3366 <?php
3367 endforeach;
3368 ?>
3369 </select>
3370 </div>
3371 </div> <!-- Legend position -->
3372 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3373 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3374 <label for="ays-chart-option-legend-alignment">
3375 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3376 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") ); ?>">
3377 <i class="ays_fa ays_fa_info_circle"></i>
3378 </a>
3379 </label>
3380 </div>
3381 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3382 <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]">
3383 <?php
3384 foreach ( $legend_alignments as $option_slug => $option ):
3385 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3386 ?>
3387 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3388 <?php
3389 endforeach;
3390 ?>
3391 </select>
3392 </div>
3393 </div> <!-- Legend alignment -->
3394 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3395 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3396 <label for="ays-chart-option-legend-font-color">
3397 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3398 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") ); ?>">
3399 <i class="ays_fa ays_fa_info_circle"></i>
3400 </a>
3401 </label>
3402 </div>
3403 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3404 <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) ?>">
3405 </div>
3406 </div> <!-- Legend font color -->
3407 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3408 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3409 <label for="ays-chart-option-legend-font-size" class="form-label">
3410 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3411 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo 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") ); ?>">
3412 <i class="ays_fa ays_fa_info_circle"></i>
3413 </a>
3414 </label>
3415 </div>
3416 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3417 <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) ?>">
3418 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3419 </div>
3420 </div> <!-- Font size -->
3421 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3422 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3423 <label for="ays-chart-option-legend-italic">
3424 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3425 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3426 <i class="ays_fa ays_fa_info_circle"></i>
3427 </a>
3428 </label>
3429 </div>
3430 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3431 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3432 <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); ?> >
3433 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3434 </label>
3435 </div>
3436 </div> <!-- Italic text -->
3437 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3438 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3439 <label for="ays-chart-option-legend-bold">
3440 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3441 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3442 <i class="ays_fa ays_fa_info_circle"></i>
3443 </a>
3444 </label>
3445 </div>
3446 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3447 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3448 <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); ?> >
3449 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3450 </label>
3451 </div>
3452 </div> <!-- Bold text -->
3453 </div>
3454 </div>
3455 <?php
3456 $content = ob_get_clean();
3457
3458 $title = __( 'Legend', "chart-builder" );
3459
3460 $sources['legend'] = array(
3461 'content' => $content,
3462 'title' => $title
3463 );
3464
3465 return $sources;
3466 }
3467
3468 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3469 $html_class_prefix = $args['html_class_prefix'];
3470 $html_name_prefix = $args['html_name_prefix'];
3471 $settings = $args['settings'];
3472
3473 $haxis_title = $settings['haxis_title'];
3474 $axes_text_positions = $settings['axes_text_positions'];
3475 $haxis_text_position = $settings['haxis_text_position'];
3476 $haxis_direction = $settings['haxis_direction'];
3477 $haxis_text_color = $settings['haxis_text_color'];
3478 $haxis_baseline_color = $settings['haxis_baseline_color'];
3479 $haxis_slanted_options = $settings['haxis_slanted_options'];
3480 $haxis_slanted = $settings['haxis_slanted'];
3481 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3482 $haxis_show_text_every = $settings['haxis_show_text_every'];
3483 $haxis_format_options = $settings['axes_format_options'];
3484 $haxis_format = $settings['haxis_format'];
3485 $haxis_label_font_size = $settings['haxis_label_font_size'];
3486 $haxis_max_value = $settings['haxis_max_value'];
3487 $haxis_min_value = $settings['haxis_min_value'];
3488 $haxis_text_font_size = $settings['haxis_text_font_size'];
3489 $haxis_label_color = $settings['haxis_label_color'];
3490 $haxis_bold = $settings['haxis_bold'];
3491 $haxis_italic = $settings['haxis_italic'];
3492 $haxis_title_bold = $settings['haxis_title_bold'];
3493 $haxis_title_italic = $settings['haxis_title_italic'];
3494 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3495 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3496 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3497
3498 ob_start();
3499 ?>
3500 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-haxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
3501 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3502 <h6>Label</h6>
3503 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3504 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3505 <label for="ays-chart-option-haxis-title" class="form-label">
3506 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3507 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the horizontal axis","chart-builder") ); ?>">
3508 <i class="ays_fa ays_fa_info_circle"></i>
3509 </a>
3510 </label>
3511 </div>
3512 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3513 <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) ?>">
3514 </div>
3515 </div> <!-- Horizontal axis label -->
3516 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3517 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3518 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3519 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3520 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3521 <i class="ays_fa ays_fa_info_circle"></i>
3522 </a>
3523 </label>
3524 </div>
3525 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3526 <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) ?>">
3527 </div>
3528 </div> <!-- Horizontal axis label font size -->
3529 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3530 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3531 <label for="ays-chart-option-haxis-label-color">
3532 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3533 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3534 <i class="ays_fa ays_fa_info_circle"></i>
3535 </a>
3536 </label>
3537 </div>
3538 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3539 <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) ?>">
3540 </div>
3541 </div> <!-- Horizontal axis label color -->
3542 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3543 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3544 <label for="ays-chart-option-haxis-title-italic">
3545 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3546 <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") ); ?>">
3547 <i class="ays_fa ays_fa_info_circle"></i>
3548 </a>
3549 </label>
3550 </div>
3551 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3552 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3553 <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); ?> >
3554 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3555 </label>
3556 </div>
3557 </div> <!-- Italic label -->
3558 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3559 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3560 <label for="ays-chart-option-haxis-title-bold">
3561 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3562 <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") ); ?>">
3563 <i class="ays_fa ays_fa_info_circle"></i>
3564 </a>
3565 </label>
3566 </div>
3567 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3568 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3569 <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); ?> >
3570 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3571 </label>
3572 </div>
3573 </div> <!-- Bold label -->
3574 <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">
3575 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3576 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3577 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3578 <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") ); ?>">
3579 <i class="ays_fa ays_fa_info_circle"></i>
3580 </a>
3581 </label>
3582 </div>
3583 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3584 <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">
3585 </div>
3586 </div> <!-- Label interval -->
3587
3588 <br>
3589 <h6>Text</h6>
3590 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3591 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3592 <label for="ays-chart-option-haxis-text-position" class="form-label">
3593 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3594 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Position of the horizontal axis text, relative to the chart area.","chart-builder") ); ?>">
3595 <i class="ays_fa ays_fa_info_circle"></i>
3596 </a>
3597 </label>
3598 </div>
3599 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3600 <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]">
3601 <?php
3602 foreach ( $axes_text_positions as $option_slug => $option ):
3603 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3604 ?>
3605 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3606 <?php
3607 endforeach;
3608 ?>
3609 </select>
3610 </div>
3611 </div> <!-- Horizontal axis text position -->
3612 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3613 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3614 <label for="ays-chart-option-haxis-text-color">
3615 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3616 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
3617 <i class="ays_fa ays_fa_info_circle"></i>
3618 </a>
3619 </label>
3620 </div>
3621 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3622 <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) ?>">
3623 </div>
3624 </div> <!-- Horizontal axis text color -->
3625 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3626 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3627 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
3628 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3629 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
3630 <i class="ays_fa ays_fa_info_circle"></i>
3631 </a>
3632 </label>
3633 </div>
3634 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3635 <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) ?>">
3636 </div>
3637 </div> <!-- Horizontal axis text font size -->
3638 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3639 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3640 <label for="ays-chart-option-haxis-text-direction">
3641 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3642 <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") ); ?>">
3643 <i class="ays_fa ays_fa_info_circle"></i>
3644 </a>
3645 </label>
3646 </div>
3647 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3648 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3649 <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); ?> >
3650 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3651 </label>
3652 </div>
3653 </div> <!-- Horizontal axis text direction -->
3654 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3655 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3656 <label for="ays-chart-option-haxis-italic">
3657 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3658 <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") ); ?>">
3659 <i class="ays_fa ays_fa_info_circle"></i>
3660 </a>
3661 </label>
3662 </div>
3663 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3664 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3665 <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); ?> >
3666 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3667 </label>
3668 </div>
3669 </div> <!-- Italic text -->
3670 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3671 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3672 <label for="ays-chart-option-haxis-bold">
3673 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3674 <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") ); ?>">
3675 <i class="ays_fa ays_fa_info_circle"></i>
3676 </a>
3677 </label>
3678 </div>
3679 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3680 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3681 <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); ?> >
3682 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3683 </label>
3684 </div>
3685 </div> <!-- Bold text -->
3686 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3687 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3688 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
3689 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
3690 <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") ); ?>">
3691 <i class="ays_fa ays_fa_info_circle"></i>
3692 </a>
3693 </label>
3694 </div>
3695 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3696 <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]">
3697 <?php
3698 foreach ( $haxis_slanted_options as $option_slug => $option ):
3699 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
3700 ?>
3701 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3702 <?php
3703 endforeach;
3704 ?>
3705 </select>
3706 </div>
3707 </div> <!-- Horizontal axis slanted text -->
3708 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
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-haxis-slanted-text-angle" class="form-label">
3711 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
3712 <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") ); ?>">
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 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3718 <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">
3719 </div>
3720 </div> <!-- Horizontal axis slanted text angle -->
3721
3722 <br>
3723 <h6>Gridlines</h6>
3724 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3725 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3726 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
3727 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
3728 <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") ); ?>">
3729 <i class="ays_fa ays_fa_info_circle"></i>
3730 </a>
3731 </label>
3732 </div>
3733 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3734 <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) ?>">
3735 </div>
3736 </div> <!-- Horizontal axis gridlines count -->
3737 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3738 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3739 <label for="ays-chart-option-haxis-gridlines-color">
3740 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3741 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
3742 <i class="ays_fa ays_fa_info_circle"></i>
3743 </a>
3744 </label>
3745 </div>
3746 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3747 <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) ?>">
3748 </div>
3749 </div> <!-- Horizontal axis gridlines color -->
3750 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3751 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3752 <label for="ays-chart-option-haxis-minor-gridlines-color">
3753 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
3754 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
3755 <i class="ays_fa ays_fa_info_circle"></i>
3756 </a>
3757 </label>
3758 </div>
3759 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3760 <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) ?>">
3761 </div>
3762 </div> <!-- Horizontal axis minor gridlines color -->
3763 <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">
3764 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3765 <label for="ays-chart-option-haxis-baseline-color">
3766 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
3767 <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") ); ?>">
3768 <i class="ays_fa ays_fa_info_circle"></i>
3769 </a>
3770 </label>
3771 </div>
3772 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3773 <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) ?>">
3774 </div>
3775 </div> <!-- Horizontal axis baseline color -->
3776
3777 <br>
3778 <h6>Format</h6>
3779 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3780 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3781 <label for="ays-chart-option-haxis-format" class="form-label">
3782 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
3783 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
3784 echo htmlspecialchars( sprintf (
3785 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
3786 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
3787 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
3788 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
3789 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
3790 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
3791 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
3792 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
3793 '<em>', '</em>',
3794 '<em>', '</em>',
3795 '<em>', '</em>',
3796 '<em>', '</em>',
3797 '<em>', '</em>',
3798 '<em>', '</em>',
3799 '<em>', '</em>'
3800 ) );
3801 ?>">
3802 <i class="ays_fa ays_fa_info_circle"></i>
3803 </a>
3804 </label>
3805 </div>
3806 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3807 <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]">
3808 <?php
3809 foreach ( $haxis_format_options as $option_slug => $option ):
3810 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
3811 ?>
3812 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3813 <?php
3814 endforeach;
3815 ?>
3816 </select>
3817 </div>
3818 </div> <!-- Horizontal axis format -->
3819 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3820 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3821 <label for="ays-chart-option-haxis-max-value" class="form-label">
3822 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
3823 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
3824 <i class="ays_fa ays_fa_info_circle"></i>
3825 </a>
3826 </label>
3827 </div>
3828 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3829 <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) ?>">
3830 </div>
3831 </div> <!-- Horizontal axis max value -->
3832 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3833 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3834 <label for="ays-chart-option-haxis-min-value" class="form-label">
3835 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
3836 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
3837 <i class="ays_fa ays_fa_info_circle"></i>
3838 </a>
3839 </label>
3840 </div>
3841 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3842 <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) ?>">
3843 </div>
3844 </div> <!-- Horizontal axis min value -->
3845 </div>
3846 </div>
3847 <?php
3848 $content = ob_get_clean();
3849
3850 $title = __( 'Horizontal Axis Settings', "chart-builder" );
3851
3852 $sources['horizontal_axis'] = array(
3853 'content' => $content,
3854 'title' => $title
3855 );
3856
3857 return $sources;
3858 }
3859
3860 public function settings_contents_vertical_axis_settings( $sources, $args ){
3861 $html_class_prefix = $args['html_class_prefix'];
3862 $html_name_prefix = $args['html_name_prefix'];
3863 $settings = $args['settings'];
3864
3865 $vaxis_title = $settings['vaxis_title'];
3866 $axes_text_positions = $settings['axes_text_positions'];
3867 $vaxis_text_position = $settings['vaxis_text_position'];
3868 $vaxis_direction = $settings['vaxis_direction'];
3869 $vaxis_text_color = $settings['vaxis_text_color'];
3870 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
3871 $vaxis_format_options = $settings['axes_format_options'];
3872 $vaxis_format = $settings['vaxis_format'];
3873 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
3874 $vaxis_max_value = $settings['vaxis_max_value'];
3875 $vaxis_min_value = $settings['vaxis_min_value'];
3876 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
3877 $vaxis_label_color = $settings['vaxis_label_color'];
3878 $vaxis_bold = $settings['vaxis_bold'];
3879 $vaxis_italic = $settings['vaxis_italic'];
3880 $vaxis_title_bold = $settings['vaxis_title_bold'];
3881 $vaxis_title_italic = $settings['vaxis_title_italic'];
3882 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
3883 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
3884 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
3885
3886 ob_start();
3887 ?>
3888 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-vaxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
3889 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3890 <h6>Label</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-vaxis-title" class="form-label">
3894 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3895 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the vertical axis","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 <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) ?>">
3902 </div>
3903 </div> <!-- Vertical axis label -->
3904 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3905 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3906 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
3907 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3908 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
3909 <i class="ays_fa ays_fa_info_circle"></i>
3910 </a>
3911 </label>
3912 </div>
3913 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3914 <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) ?>">
3915 </div>
3916 </div> <!-- Vertical axis label font size -->
3917 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3918 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3919 <label for="ays-chart-option-vaxis-label-color">
3920 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3921 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3922 <i class="ays_fa ays_fa_info_circle"></i>
3923 </a>
3924 </label>
3925 </div>
3926 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3927 <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) ?>">
3928 </div>
3929 </div> <!-- Vertical axis label color -->
3930 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3931 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3932 <label for="ays-chart-option-vaxis-title-italic">
3933 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3934 <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") ); ?>">
3935 <i class="ays_fa ays_fa_info_circle"></i>
3936 </a>
3937 </label>
3938 </div>
3939 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3940 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3941 <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); ?> >
3942 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3943 </label>
3944 </div>
3945 </div> <!-- Italic label -->
3946 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3947 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3948 <label for="ays-chart-option-vaxis-title-bold">
3949 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3950 <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") ); ?>">
3951 <i class="ays_fa ays_fa_info_circle"></i>
3952 </a>
3953 </label>
3954 </div>
3955 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3956 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3957 <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); ?> >
3958 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3959 </label>
3960 </div>
3961 </div> <!-- Bold label -->
3962
3963 <br>
3964 <h6>Text</h6>
3965 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3966 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3967 <label for="ays-chart-option-vaxis-text-position" class="form-label">
3968 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3969 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Position of the vertical axis text, relative to the chart area.","chart-builder") ); ?>">
3970 <i class="ays_fa ays_fa_info_circle"></i>
3971 </a>
3972 </label>
3973 </div>
3974 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3975 <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]">
3976 <?php
3977 foreach ( $axes_text_positions as $option_slug => $option ):
3978 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
3979 ?>
3980 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3981 <?php
3982 endforeach;
3983 ?>
3984 </select>
3985 </div>
3986 </div> <!-- Vertical axis text position -->
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-vaxis-text-color">
3990 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3991 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","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) ?>input-align-right">
3997 <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) ?>">
3998 </div>
3999 </div> <!-- Vertical axis text color -->
4000 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4001 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4002 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4003 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4004 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4005 <i class="ays_fa ays_fa_info_circle"></i>
4006 </a>
4007 </label>
4008 </div>
4009 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4010 <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) ?>">
4011 </div>
4012 </div> <!-- Vertical axis text font size -->
4013 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4014 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4015 <label for="ays-chart-option-vaxis-text-direction">
4016 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4017 <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") ); ?>">
4018 <i class="ays_fa ays_fa_info_circle"></i>
4019 </a>
4020 </label>
4021 </div>
4022 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4023 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4024 <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); ?> >
4025 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4026 </label>
4027 </div>
4028 </div> <!-- Vertical axis text direction -->
4029 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4030 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4031 <label for="ays-chart-option-vaxis-italic">
4032 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4033 <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") ); ?>">
4034 <i class="ays_fa ays_fa_info_circle"></i>
4035 </a>
4036 </label>
4037 </div>
4038 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4039 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4040 <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); ?> >
4041 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4042 </label>
4043 </div>
4044 </div> <!-- Italic text -->
4045 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4046 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4047 <label for="ays-chart-option-vaxis-bold">
4048 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4049 <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") ); ?>">
4050 <i class="ays_fa ays_fa_info_circle"></i>
4051 </a>
4052 </label>
4053 </div>
4054 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4055 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4056 <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); ?> >
4057 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4058 </label>
4059 </div>
4060 </div> <!-- Bold text -->
4061
4062 <br>
4063 <h6>Gridlines</h6>
4064 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-vaxis-gridlines-count" class="form-label">
4067 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4068 <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") ); ?>">
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) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4074 <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) ?>">
4075 </div>
4076 </div> <!-- Vertical axis gridlines count -->
4077 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4078 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4079 <label for="ays-chart-option-vaxis-gridlines-color">
4080 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4081 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4082 <i class="ays_fa ays_fa_info_circle"></i>
4083 </a>
4084 </label>
4085 </div>
4086 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4087 <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) ?>">
4088 </div>
4089 </div> <!-- Vertical axis gridlines color -->
4090 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4091 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4092 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4093 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4094 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4095 <i class="ays_fa ays_fa_info_circle"></i>
4096 </a>
4097 </label>
4098 </div>
4099 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4100 <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) ?>">
4101 </div>
4102 </div> <!-- Vertical axis minor gridlines color -->
4103 <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">
4104 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4105 <label for="ays-chart-option-vaxis-baseline-color">
4106 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4107 <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") ); ?>">
4108 <i class="ays_fa ays_fa_info_circle"></i>
4109 </a>
4110 </label>
4111 </div>
4112 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4113 <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) ?>">
4114 </div>
4115 </div> <!-- Vertical axis baseline color -->
4116
4117 <br>
4118 <h6>Format</h6>
4119 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4120 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4121 <label for="ays-chart-option-vaxis-format" class="form-label">
4122 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4123 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4124 echo htmlspecialchars( sprintf (
4125 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4126 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4127 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4128 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4129 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4130 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4131 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4132 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4133 '<em>', '</em>',
4134 '<em>', '</em>',
4135 '<em>', '</em>',
4136 '<em>', '</em>',
4137 '<em>', '</em>',
4138 '<em>', '</em>',
4139 '<em>', '</em>'
4140 ) );
4141 ?>">
4142 <i class="ays_fa ays_fa_info_circle"></i>
4143 </a>
4144 </label>
4145 </div>
4146 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4147 <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]">
4148 <?php
4149 foreach ( $vaxis_format_options as $option_slug => $option ):
4150 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4151 ?>
4152 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4153 <?php
4154 endforeach;
4155 ?>
4156 </select>
4157 </div>
4158 </div> <!-- Vertical axis format -->
4159 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4160 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4161 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4162 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4163 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4164 <i class="ays_fa ays_fa_info_circle"></i>
4165 </a>
4166 </label>
4167 </div>
4168 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4169 <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) ?>">
4170 </div>
4171 </div> <!-- Vertical axis max value -->
4172 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4173 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4174 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4175 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4176 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4177 <i class="ays_fa ays_fa_info_circle"></i>
4178 </a>
4179 </label>
4180 </div>
4181 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4182 <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) ?>">
4183 </div>
4184 </div> <!-- Vertical axis min value -->
4185 </div>
4186 </div>
4187 <?php
4188 $content = ob_get_clean();
4189
4190 $title = __( 'Vertical Axis Settings', "chart-builder" );
4191
4192 $sources['vertical_axis'] = array(
4193 'content' => $content,
4194 'title' => $title
4195 );
4196
4197 return $sources;
4198 }
4199
4200 public function settings_contents_animation_settings( $sources, $args ) {
4201 $html_class_prefix = $args['html_class_prefix'];
4202 $html_name_prefix = $args['html_name_prefix'];
4203 $settings = $args['settings'];
4204
4205 $enable_animation = $settings['enable_animation'];
4206 $animation_duration = $settings['animation_duration'];
4207 $animation_startup = $settings['animation_startup'];
4208 $animation_easing_options = $settings['animation_easing_options'];
4209 $animation_easing = $settings['animation_easing'];
4210
4211 ob_start();
4212 ?>
4213 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-animation-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
4214 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4215 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4216 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4217 <label for="ays-chart-option-enable-animation">
4218 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4219 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4220 <i class="ays_fa ays_fa_info_circle"></i>
4221 </a>
4222 </label>
4223 </div>
4224 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4225 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4226 <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); ?> >
4227 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4228 </label>
4229 </div>
4230 </div> <!-- Enable animation -->
4231 <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'; ?>">
4232 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4233 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4234 <label for="ays-chart-option-animation-duration" class="form-label">
4235 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4236 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4237 <i class="ays_fa ays_fa_info_circle"></i>
4238 </a>
4239 </label>
4240 </div>
4241 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4242 <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) ?>">
4243 </div>
4244 </div> <!-- Animation duration -->
4245 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4246 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4247 <label for="ays-chart-option-animation-startup">
4248 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4249 <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") ); ?>">
4250 <i class="ays_fa ays_fa_info_circle"></i>
4251 </a>
4252 </label>
4253 </div>
4254 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4255 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4256 <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); ?> >
4257 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4258 </label>
4259 </div>
4260 </div> <!-- Animation startup -->
4261 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4262 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4263 <label for="ays-chart-option-animation-easing" class="form-label">
4264 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4265 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4266 echo htmlspecialchars( sprintf(
4267 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4268 __('%sLinear:%s Constant speed.', "chart-builder") . "</li><li>" .
4269 __('%sEase in:%s Start slow and speed up.', "chart-builder") . "</li><li>" .
4270 __('%sEase out:%s Start fast and slow down.', "chart-builder") . "</li><li>" .
4271 __('%sEase in and out:%s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4272 '<em>',
4273 '</em>',
4274 '<em>',
4275 '</em>',
4276 '<em>',
4277 '</em>',
4278 '<em>',
4279 '</em>'
4280 ) );
4281 ?>">
4282 <i class="ays_fa ays_fa_info_circle"></i>
4283 </a>
4284 </label>
4285 </div>
4286 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4287 <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]">
4288 <?php
4289 foreach ( $animation_easing_options as $option_slug => $option ):
4290 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4291 ?>
4292 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4293 <?php
4294 endforeach;
4295 ?>
4296 </select>
4297 </div>
4298 </div> <!-- Animation easing -->
4299 <div>
4300 </div>
4301 </div>
4302 <?php
4303 $content = ob_get_clean();
4304
4305 $title = __( 'Chart animation', "chart-builder" );
4306
4307 $sources['animation'] = array(
4308 'content' => $content,
4309 'title' => $title
4310 );
4311
4312 return $sources;
4313 }
4314
4315 public function settings_contents_live_chart_settings( $sources, $args ) {
4316 $html_class_prefix = $args['html_class_prefix'];
4317 $html_name_prefix = $args['html_name_prefix'];
4318
4319 ob_start();
4320 ?>
4321 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-live-chart-settings-tab">
4322 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4323 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4324 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4325 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4326 <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>
4327 <div class="ays-pro-features-v2-video-text">
4328 <?php echo __("Watch Video" , "chart-builder"); ?>
4329 </div>
4330 </a>
4331 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4332 <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>
4333 <div class="ays-pro-features-v2-upgrade-text">
4334 <?php echo __("Upgrade" , "chart-builder"); ?>
4335 </div>
4336 </a>
4337 </div>
4338 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4339 <label for="ays-chart-option-enable-live-chart">
4340 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4341 <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") ); ?>">
4342 <i class="ays_fa ays_fa_info_circle"></i>
4343 </a>
4344 </label>
4345 </div>
4346 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4347 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4348 <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">
4349 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4350 </label>
4351 </div>
4352 </div> <!-- Enable live chart -->
4353 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4354 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4355 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4356 <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>
4357 <div class="ays-pro-features-v2-video-text">
4358 <?php echo __("Watch Video" , "chart-builder"); ?>
4359 </div>
4360 </a>
4361 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4362 <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>
4363 <div class="ays-pro-features-v2-upgrade-text">
4364 <?php echo __("Upgrade" , "chart-builder"); ?>
4365 </div>
4366 </a>
4367 </div>
4368 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4369 <label for="ays-chart-option-live-chart-interval" class="form-label">
4370 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4371 <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") ); ?>">
4372 <i class="ays_fa ays_fa_info_circle"></i>
4373 </a>
4374 </label>
4375 </div>
4376 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4377 <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">
4378 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4379 </div>
4380 </div> <!-- Live chart interval -->
4381 </div>
4382 </div>
4383 <?php
4384 $content = ob_get_clean();
4385
4386 $title = __( 'Live Chart', "chart-builder" );
4387
4388 $sources['live_chart'] = array(
4389 'content' => $content,
4390 'title' => $title
4391 );
4392
4393 return $sources;
4394
4395 }
4396
4397 public function settings_contents_export_options( $sources, $args ){
4398 $html_class_prefix = $args['html_class_prefix'];
4399 $html_name_prefix = $args['html_name_prefix'];
4400 $settings = $args['settings'];
4401
4402 $enable_img = $settings['enable_img'];
4403
4404 ob_start();
4405 ?>
4406 <div class="ays-accordion-data-main-wrap <?= $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">
4407 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4408 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4409 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4410 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4411 <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>
4412 <div class="ays-pro-features-v2-video-text">
4413 <?php echo __("Watch Video" , "chart-builder"); ?>
4414 </div>
4415 </a>
4416 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4417 <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>
4418 <div class="ays-pro-features-v2-upgrade-text">
4419 <?php echo __("Upgrade" , "chart-builder"); ?>
4420 </div>
4421 </a>
4422 </div>
4423 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4424 <label for="ays-chart-option-export-print">
4425 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4426 <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") ); ?>">
4427 <i class="ays_fa ays_fa_info_circle"></i>
4428 </a>
4429 </label>
4430 </div>
4431 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4432 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4433 <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">
4434 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4435 </label>
4436 </div>
4437 </div> <!-- Print option end -->
4438 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4439 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4440 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4441 <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>
4442 <div class="ays-pro-features-v2-video-text">
4443 <?php echo __("Watch Video" , "chart-builder"); ?>
4444 </div>
4445 </a>
4446 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4447 <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>
4448 <div class="ays-pro-features-v2-upgrade-text">
4449 <?php echo __("Upgrade" , "chart-builder"); ?>
4450 </div>
4451 </a>
4452 </div>
4453 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4454 <label for="ays-chart-option-export-Excel">
4455 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4456 <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") ); ?>">
4457 <i class="ays_fa ays_fa_info_circle"></i>
4458 </a>
4459 </label>
4460 </div>
4461 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4462 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4463 <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">
4464 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4465 </label>
4466 </div>
4467 </div> <!-- Excel option end -->
4468 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4469 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4470 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4471 <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>
4472 <div class="ays-pro-features-v2-video-text">
4473 <?php echo __("Watch Video" , "chart-builder"); ?>
4474 </div>
4475 </a>
4476 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4477 <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>
4478 <div class="ays-pro-features-v2-upgrade-text">
4479 <?php echo __("Upgrade" , "chart-builder"); ?>
4480 </div>
4481 </a>
4482 </div>
4483 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4484 <label for="ays-chart-option-export-CSV">
4485 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4486 <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") ); ?>">
4487 <i class="ays_fa ays_fa_info_circle"></i>
4488 </a>
4489 </label>
4490 </div>
4491 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4492 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4493 <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">
4494 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4495 </label>
4496 </div>
4497 </div> <!-- CSV option end -->
4498 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4499 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4500 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4501 <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>
4502 <div class="ays-pro-features-v2-video-text">
4503 <?php echo __("Watch Video" , "chart-builder"); ?>
4504 </div>
4505 </a>
4506 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4507 <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>
4508 <div class="ays-pro-features-v2-upgrade-text">
4509 <?php echo __("Upgrade" , "chart-builder"); ?>
4510 </div>
4511 </a>
4512 </div>
4513 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4514 <label for="ays-chart-option-export-Copy">
4515 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4516 <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") ); ?>">
4517 <i class="ays_fa ays_fa_info_circle"></i>
4518 </a>
4519 </label>
4520 </div>
4521 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4522 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4523 <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">
4524 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4525 </label>
4526 </div>
4527 </div> <!-- Copy option end -->
4528 <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">
4529 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4530 <label for="ays-chart-option-export-img">
4531 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4532 <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") ); ?>">
4533 <i class="ays_fa ays_fa_info_circle"></i>
4534 </a>
4535 </label>
4536 </div>
4537 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4538 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4539 <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 $enable_img?> >
4540 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4541 </label>
4542 </div>
4543 </div> <!-- IMG option end -->
4544 </div>
4545 </div>
4546 <?php
4547
4548 $content = ob_get_clean();
4549
4550 $title = __( 'Frontend Actions', "chart-builder" );
4551
4552 $sources['export_options'] = array(
4553 'content' => $content,
4554 'title' => $title
4555 );
4556
4557 return $sources;
4558 }
4559
4560 /**
4561 * Chart page styles contents
4562 * @param $args
4563 */
4564 public function ays_chart_page_styles_contents( $args ){
4565 $chart_source_type = $args['chart_source_type'];
4566
4567 if ($chart_source_type === 'chart-js') {
4568 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4569 } else {
4570 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4571 }
4572
4573 $sources = array();
4574 foreach ( $sources_contents as $key => $sources_content ) {
4575 $collapsed = $key == 'chart' ? 'false' : 'true';
4576
4577 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4578 if(isset($sources_content['title'])){
4579 $content .= '<legend class="ays-accordion-options-header">';
4580 $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">
4581 <g>
4582 <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" />
4583 </g>
4584 </svg>';
4585
4586 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4587 }
4588
4589 $content .= '<div class="ays-accordion-options-content">';
4590 $content .= $sources_content['content'];
4591 $content .= '</div>';
4592
4593 $content .= '</fieldset>';
4594
4595 $sources[] = $content;
4596 }
4597 $content_for_escape = implode('' , $sources );
4598 echo html_entity_decode(esc_html( $content_for_escape ));
4599 }
4600
4601 public function settings_contents_chart_styles_settings( $sources, $args ){
4602 $html_class_prefix = $args['html_class_prefix'];
4603 $html_name_prefix = $args['html_name_prefix'];
4604 $settings = $args['settings'];
4605
4606 $width = $settings['width'];
4607 $width_format = $settings['width_format'];
4608 $title_positions = $settings['title_positions'];
4609 $position = $settings['position'];
4610 $width_format_options = $settings['width_format_options'];
4611 $responsive_width = $settings['responsive_width'];
4612 $height = $settings['height'];
4613 $height_format = $settings['height_format'];
4614 $font_size = $settings['font_size'];
4615 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4616 $org_chart_font_size = $settings['org_chart_font_size'];
4617 $background_color = $settings['background_color'];
4618 $transparent_background = $settings['transparent_background'];
4619 $border_width = $settings['border_width'];
4620 $border_radius = $settings['border_radius'];
4621 $border_color = $settings['border_color'];
4622 $box_shadow = $settings['box_shadow'];
4623 $box_shadow_color = $settings['box_shadow_color'];
4624 ob_start();
4625 ?>
4626 <div class="ays-accordion-data-main-wrap">
4627 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4628 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4629 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4630 <label for="ays-chart-option-width" class="form-label">
4631 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
4632 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container, in percents.","chart-builder") ); ?>">
4633 <i class="ays_fa ays_fa_info_circle"></i>
4634 </a>
4635 </label>
4636 </div>
4637 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4638 <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) ?>">
4639 <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]">
4640 <?php
4641 foreach ( $width_format_options as $option_slug => $option ):
4642 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
4643 ?>
4644 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4645 <?php
4646 endforeach;
4647 ?>
4648 </select>
4649 </div>
4650 </div> <!-- Width -->
4651 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4652 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4653 <label for="ays-chart-option-responsive-width" class="form-label">
4654 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
4655 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("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") ); ?>">
4656 <i class="ays_fa ays_fa_info_circle"></i>
4657 </a>
4658 </label>
4659 </div>
4660 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4661 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4662 <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); ?> >
4663 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4664 </label>
4665 </div>
4666 </div> <!-- Responsive Width -->
4667 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4668 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4669 <label for="ays-chart-option-position">
4670 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4671 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart. Note: The changes will be visible when the width option is not set to 100%","chart-builder") ); ?>">
4672 <i class="ays_fa ays_fa_info_circle"></i>
4673 </a>
4674 </label>
4675 </div>
4676 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4677 <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]">
4678 <?php
4679 foreach ( $title_positions as $option_slug => $option ):
4680 $selected = ( $position == $option_slug ) ? 'selected' : '';
4681 ?>
4682 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4683 <?php
4684 endforeach;
4685 ?>
4686 </select>
4687 </div>
4688 </div> <!-- Title position -->
4689 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4690 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4691 <label for="ays-chart-option-height" class="form-label">
4692 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
4693 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
4694 <i class="ays_fa ays_fa_info_circle"></i>
4695 </a>
4696 </label>
4697 </div>
4698 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4699 <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) ?>">
4700 <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]">
4701 <?php
4702 foreach ( $width_format_options as $option_slug => $option ):
4703 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
4704 ?>
4705 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4706 <?php
4707 endforeach;
4708 ?>
4709 </select>
4710 </div>
4711 </div> <!-- Height -->
4712 <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">
4713 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4714 <label for="ays-chart-option-font-size" class="form-label">
4715 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4716 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart text.","chart-builder") ); ?>">
4717 <i class="ays_fa ays_fa_info_circle"></i>
4718 </a>
4719 </label>
4720 </div>
4721 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4722 <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) ?>">
4723 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
4724 </div>
4725 </div> <!-- Font size -->
4726 <div class="form-group row mb-2 <?= $html_class_prefix ?>options-section cb-changable-opt cb-org_chart-opt display_none">
4727 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
4728 <label for="ays-chart-option-org-chart-font-size" class="form-label">
4729 <?php echo __( "Element size", $this->plugin_name ); ?>
4730 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The size of the chart element.","chart-builder") ); ?>">
4731 <i class="ays_fa ays_fa_info_circle"></i>
4732 </a>
4733 </label>
4734 </div>
4735 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4736 <select class="<?= $html_class_prefix ?>option-select-input form-select" id="ays-chart-option-org-chart-font-size" name="<?php echo $html_name_prefix; ?>settings[org_chart_font_size]">
4737 <?php
4738 foreach ( $org_chart_font_size_options as $option_slug => $option ):
4739 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
4740 ?>
4741 <option value="<?php echo $option_slug; ?>" <?php echo $selected; ?>><?php echo $option; ?></option>
4742 <?php
4743 endforeach;
4744 ?>
4745 </select>
4746 </div>
4747 </div> <!-- Font size for org type -->
4748 <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">
4749 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4750 <label for="ays-chart-option-background-color">
4751 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4752 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart container.","chart-builder") ); ?>">
4753 <i class="ays_fa ays_fa_info_circle"></i>
4754 </a>
4755 </label>
4756 </div>
4757 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4758 <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) ?>">
4759 </div>
4760 </div> <!-- Background color -->
4761 <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">
4762 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4763 <label for="ays-chart-option-transparent-background" class="form-label">
4764 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
4765 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("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") ); ?>">
4766 <i class="ays_fa ays_fa_info_circle"></i>
4767 </a>
4768 </label>
4769 </div>
4770 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4771 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4772 <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); ?> >
4773 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4774 </label>
4775 </div>
4776 </div> <!-- Transparent background -->
4777 <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">
4778 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4779 <label for="ays-chart-option-border-width">
4780 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4781 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container border.","chart-builder") ); ?>">
4782 <i class="ays_fa ays_fa_info_circle"></i>
4783 </a>
4784 </label>
4785 </div>
4786 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4787 <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) ?>">
4788 </div>
4789 </div> <!-- Border Width -->
4790 <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">
4791 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4792 <label for="ays-chart-option-border-color">
4793 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4794 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart container.","chart-builder") ); ?>">
4795 <i class="ays_fa ays_fa_info_circle"></i>
4796 </a>
4797 </label>
4798 </div>
4799 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4800 <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) ?>">
4801 </div>
4802 </div> <!-- Border color -->
4803 <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">
4804 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4805 <label for="ays-chart-option-border-radius">
4806 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
4807 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border radius of the chart container.","chart-builder") ); ?>">
4808 <i class="ays_fa ays_fa_info_circle"></i>
4809 </a>
4810 </label>
4811 </div>
4812 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4813 <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) ?>">
4814 </div>
4815 </div> <!-- Border radius -->
4816 <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">
4817 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4818 <label for="ays-chart-option-box-shadow" class="form-label">
4819 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
4820 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
4821 <i class="ays_fa ays_fa_info_circle"></i>
4822 </a>
4823 </label>
4824 </div>
4825 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4826 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4827 <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); ?> >
4828 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4829 </label>
4830 </div>
4831 </div> <!-- box shadow -->
4832 <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">
4833 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4834 <label for="ays-chart-option-box-shadow-color" class="form-label">
4835 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
4836 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
4837 <i class="ays_fa ays_fa_info_circle"></i>
4838 </a>
4839 </label>
4840 </div>
4841 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4842 <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) ?>">
4843 </div>
4844 </div> <!-- box shadow color -->
4845 </div>
4846 </div>
4847 <?php
4848 $content = ob_get_clean();
4849
4850 $title = __( 'Chart', "chart-builder" );
4851
4852 $sources['chart'] = array(
4853 'content' => $content,
4854 'title' => $title
4855 );
4856
4857 return $sources;
4858 }
4859
4860 public function settings_contents_chart_area_styles_settings( $sources, $args ){
4861 $html_class_prefix = $args['html_class_prefix'];
4862 $html_name_prefix = $args['html_name_prefix'];
4863 $settings = $args['settings'];
4864
4865 $chart_background_color = $settings['chart_background_color'];
4866 $chart_border_color = $settings['chart_border_color'];
4867 $chart_left_margin = $settings['chart_left_margin'];
4868 $chart_right_margin = $settings['chart_right_margin'];
4869 $chart_top_margin = $settings['chart_top_margin'];
4870 $chart_bottom_margin = $settings['chart_bottom_margin'];
4871 $chart_border_width = $settings['chart_border_width'];
4872 ob_start();
4873 ?>
4874 <div class="ays-accordion-data-main-wrap">
4875 <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">
4876 <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">
4877 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4878 <label for="ays-chart-option-chart-background-color">
4879 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4880 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart area.","chart-builder") ); ?>">
4881 <i class="ays_fa ays_fa_info_circle"></i>
4882 </a>
4883 </label>
4884 </div>
4885 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4886 <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) ?>">
4887 </div>
4888 </div> <!-- Chart Area background color -->
4889 <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">
4890 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4891 <label for="ays-chart-option-chart-border-width">
4892 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4893 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border width of the chart area.","chart-builder") ); ?>">
4894 <i class="ays_fa ays_fa_info_circle"></i>
4895 </a>
4896 </label>
4897 </div>
4898 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4899 <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) ?>">
4900 </div>
4901 </div> <!-- Chart Area Border Width -->
4902 <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">
4903 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4904 <label for="ays-chart-option-chart-border-color">
4905 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4906 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart area.","chart-builder") ); ?>">
4907 <i class="ays_fa ays_fa_info_circle"></i>
4908 </a>
4909 </label>
4910 </div>
4911 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4912 <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) ?>">
4913 </div>
4914 </div> <!-- Chart Area border color -->
4915 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4916 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4917 <label for="ays-chart-option-chart-left-margin">
4918 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
4919 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the left border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4920 <i class="ays_fa ays_fa_info_circle"></i>
4921 </a>
4922 </label>
4923 </div>
4924 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4925 <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) ?>">
4926 </div>
4927 </div> <!-- Chart Area Left Margin -->
4928 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4929 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4930 <label for="ays-chart-option-chart-right-margin">
4931 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
4932 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the right border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4933 <i class="ays_fa ays_fa_info_circle"></i>
4934 </a>
4935 </label>
4936 </div>
4937 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4938 <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) ?>">
4939 </div>
4940 </div> <!-- Chart Area Right Margin -->
4941 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4942 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4943 <label for="ays-chart-option-chart-top-margin">
4944 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
4945 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the top border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4946 <i class="ays_fa ays_fa_info_circle"></i>
4947 </a>
4948 </label>
4949 </div>
4950 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4951 <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) ?>">
4952 </div>
4953 </div> <!-- Chart Area Top Margin -->
4954 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4955 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4956 <label for="ays-chart-option-chart-bottom-margin">
4957 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
4958 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the bottom border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4959 <i class="ays_fa ays_fa_info_circle"></i>
4960 </a>
4961 </label>
4962 </div>
4963 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4964 <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) ?>">
4965 </div>
4966 </div> <!-- Chart Area Bottom Margin -->
4967 </div>
4968 </div>
4969 <?php
4970 $content = ob_get_clean();
4971
4972 $title = __( 'Chart Area', "chart-builder" );
4973
4974 $sources['chart_area'] = array(
4975 'content' => $content,
4976 'title' => $title
4977 );
4978
4979 return $sources;
4980 }
4981
4982 public function settings_contents_title_styles_settings( $sources, $args ){
4983 $html_class_prefix = $args['html_class_prefix'];
4984 $html_name_prefix = $args['html_name_prefix'];
4985 $settings = $args['settings'];
4986
4987 $title_color = $settings['title_color'];
4988 $title_shadow_color = $settings['title_shadow_color'];
4989 $title_font_size = $settings['title_font_size'];
4990 $title_gap = $settings['title_gap'];
4991 $title_gap_description = $settings['title_gap_description'];
4992 $title_positions = $settings['title_positions'];
4993 $title_position = $settings['title_position'];
4994 $title_bold = $settings['title_bold'];
4995 $title_text_shadow = $settings['title_text_shadow'];
4996 $title_italic = $settings['title_italic'];
4997 $text_transforms = $settings['text_transforms'];
4998 $text_decorations = $settings['text_decorations'];
4999 $title_text_transform = $settings['title_text_transform'];
5000 $title_text_decoration = $settings['title_text_decoration'];
5001 $title_letter_spacing = $settings['title_letter_spacing'];
5002 ob_start();
5003 ?>
5004 <div class="ays-accordion-data-main-wrap">
5005 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5006 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5007 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5008 <label for="ays-chart-option-title-color">
5009 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5010 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5011 <i class="ays_fa ays_fa_info_circle"></i>
5012 </a>
5013 </label>
5014 </div>
5015 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5016 <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) ?>">
5017 </div>
5018 </div> <!-- Chart title color -->
5019 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5020 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5021 <label for="ays-chart-option-title-font-size" class="form-label">
5022 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5023 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5024 <i class="ays_fa ays_fa_info_circle"></i>
5025 </a>
5026 </label>
5027 </div>
5028 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5029 <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) ?>">
5030 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5031 </div>
5032 </div> <!-- Chart title font size -->
5033 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5034 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5035 <label for="ays-chart-option-title-bold" class="form-label">
5036 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5037 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5038 <i class="ays_fa ays_fa_info_circle"></i>
5039 </a>
5040 </label>
5041 </div>
5042 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5043 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5044 <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); ?> >
5045 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5046 </label>
5047 </div>
5048 </div> <!-- Title bold -->
5049 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5050 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5051 <label for="ays-chart-option-title-italic" class="form-label">
5052 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5053 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5054 <i class="ays_fa ays_fa_info_circle"></i>
5055 </a>
5056 </label>
5057 </div>
5058 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5059 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5060 <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); ?> >
5061 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5062 </label>
5063 </div>
5064 </div> <!-- Title italic -->
5065 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5066 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5067 <label for="ays-chart-option-title-position">
5068 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5069 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5070 <i class="ays_fa ays_fa_info_circle"></i>
5071 </a>
5072 </label>
5073 </div>
5074 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5075 <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]">
5076 <?php
5077 foreach ( $title_positions as $option_slug => $option ):
5078 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5079 ?>
5080 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5081 <?php
5082 endforeach;
5083 ?>
5084 </select>
5085 </div>
5086 </div> <!-- Title position -->
5087 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5088 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5089 <label for="ays-chart-option-title-gap" class="form-label">
5090 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5091 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
5092 <i class="ays_fa ays_fa_info_circle"></i>
5093 </a>
5094 </label>
5095 </div>
5096 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5097 <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) ?>">
5098 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5099 </div>
5100 </div> <!-- Chart title gap -->
5101 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5102 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5103 <label for="ays-chart-option-title-gap-description" class="form-label">
5104 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5105 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
5106 <i class="ays_fa ays_fa_info_circle"></i>
5107 </a>
5108 </label>
5109 </div>
5110 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5111 <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) ?>">
5112 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5113 </div>
5114 </div> <!-- Chart title gap -->
5115 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-title-text-transform">
5118 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5119 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","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) ?>option-input">
5125 <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]">
5126 <?php
5127 foreach ( $text_transforms as $option_slug => $option ):
5128 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5129 ?>
5130 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5131 <?php
5132 endforeach;
5133 ?>
5134 </select>
5135 </div>
5136 </div> <!-- Title text transform -->
5137 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5138 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5139 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5140 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5141 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5142 <i class="ays_fa ays_fa_info_circle"></i>
5143 </a>
5144 </label>
5145 </div>
5146 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5147 <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) ?>">
5148 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5149 </div>
5150 </div> <!-- Chart title letter spacing -->
5151 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5152 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5153 <label for="ays-chart-option-title-text-decoration">
5154 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5155 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5156 <i class="ays_fa ays_fa_info_circle"></i>
5157 </a>
5158 </label>
5159 </div>
5160 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5161 <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]">
5162 <?php
5163 foreach ( $text_decorations as $option_slug => $option ):
5164 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5165 ?>
5166 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5167 <?php
5168 endforeach;
5169 ?>
5170 </select>
5171 </div>
5172 </div> <!-- Title text decoration -->
5173 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5174 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5175 <label for="ays-chart-option-title-text-shadow" class="form-label">
5176 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5177 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
5178 <i class="ays_fa ays_fa_info_circle"></i>
5179 </a>
5180 </label>
5181 </div>
5182 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5183 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5184 <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); ?> >
5185 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5186 </label>
5187 </div>
5188 </div> <!-- Title bold -->
5189 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5190 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5191 <label for="ays-chart-option-title-shadow-color">
5192 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5193 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5194 <i class="ays_fa ays_fa_info_circle"></i>
5195 </a>
5196 </label>
5197 </div>
5198 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5199 <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) ?>">
5200 </div>
5201 </div> <!-- Chart title color -->
5202 </div>
5203 </div>
5204 <?php
5205 $content = ob_get_clean();
5206
5207 $title = __( 'Title', "chart-builder" );
5208
5209 $sources['title'] = array(
5210 'content' => $content,
5211 'title' => $title
5212 );
5213
5214 return $sources;
5215 }
5216
5217 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5218 $html_class_prefix = $args['html_class_prefix'];
5219 $html_name_prefix = $args['html_name_prefix'];
5220 $settings = $args['settings'];
5221
5222 $title_color = $settings['title_color'];
5223 $title_shadow_color = $settings['title_shadow_color'];
5224 $title_font_size = $settings['title_font_size'];
5225 $title_gap = $settings['title_gap'];
5226 $title_gap_description = $settings['title_gap_description'];
5227 $title_positions = $settings['title_positions'];
5228 $title_position = $settings['title_position'];
5229 $title_bold = $settings['title_bold'];
5230 $title_text_shadow = $settings['title_text_shadow'];
5231 $title_italic = $settings['title_italic'];
5232 $text_transforms = $settings['text_transforms'];
5233 $text_decorations = $settings['text_decorations'];
5234 $title_text_transform = $settings['title_text_transform'];
5235 $title_text_decoration = $settings['title_text_decoration'];
5236 $title_letter_spacing = $settings['title_letter_spacing'];
5237 ob_start();
5238 ?>
5239 <div class="ays-accordion-data-main-wrap">
5240 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5241 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5242 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5243 <label for="ays-chart-option-title-color">
5244 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5245 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5246 <i class="ays_fa ays_fa_info_circle"></i>
5247 </a>
5248 </label>
5249 </div>
5250 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5251 <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) ?>">
5252 </div>
5253 </div> <!-- Chart title color -->
5254 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5255 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5256 <label for="ays-chart-option-title-font-size" class="form-label">
5257 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5258 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5259 <i class="ays_fa ays_fa_info_circle"></i>
5260 </a>
5261 </label>
5262 </div>
5263 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5264 <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) ?>">
5265 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5266 </div>
5267 </div> <!-- Chart title font size -->
5268 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5269 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5270 <label for="ays-chart-option-title-bold" class="form-label">
5271 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5272 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5273 <i class="ays_fa ays_fa_info_circle"></i>
5274 </a>
5275 </label>
5276 </div>
5277 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5278 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5279 <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); ?> >
5280 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5281 </label>
5282 </div>
5283 </div> <!-- Title bold -->
5284 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5285 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5286 <label for="ays-chart-option-title-italic" class="form-label">
5287 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5288 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5289 <i class="ays_fa ays_fa_info_circle"></i>
5290 </a>
5291 </label>
5292 </div>
5293 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5294 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5295 <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); ?> >
5296 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5297 </label>
5298 </div>
5299 </div> <!-- Title italic -->
5300 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5301 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5302 <label for="ays-chart-option-title-position">
5303 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5304 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5305 <i class="ays_fa ays_fa_info_circle"></i>
5306 </a>
5307 </label>
5308 </div>
5309 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5310 <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]">
5311 <?php
5312 foreach ( $title_positions as $option_slug => $option ):
5313 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5314 ?>
5315 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5316 <?php
5317 endforeach;
5318 ?>
5319 </select>
5320 </div>
5321 </div> <!-- Title position -->
5322 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5323 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5324 <label for="ays-chart-option-title-gap" class="form-label">
5325 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5326 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
5327 <i class="ays_fa ays_fa_info_circle"></i>
5328 </a>
5329 </label>
5330 </div>
5331 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5332 <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) ?>">
5333 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5334 </div>
5335 </div> <!-- Chart title gap -->
5336 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5337 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5338 <label for="ays-chart-option-title-gap-description" class="form-label">
5339 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5340 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
5341 <i class="ays_fa ays_fa_info_circle"></i>
5342 </a>
5343 </label>
5344 </div>
5345 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5346 <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) ?>">
5347 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5348 </div>
5349 </div> <!-- Chart title gap -->
5350 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5351 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5352 <label for="ays-chart-option-title-text-transform">
5353 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5354 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5355 <i class="ays_fa ays_fa_info_circle"></i>
5356 </a>
5357 </label>
5358 </div>
5359 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5360 <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]">
5361 <?php
5362 foreach ( $text_transforms as $option_slug => $option ):
5363 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5364 ?>
5365 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5366 <?php
5367 endforeach;
5368 ?>
5369 </select>
5370 </div>
5371 </div> <!-- Title text transform -->
5372 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5373 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5374 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5375 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5376 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5377 <i class="ays_fa ays_fa_info_circle"></i>
5378 </a>
5379 </label>
5380 </div>
5381 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5382 <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) ?>">
5383 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5384 </div>
5385 </div> <!-- Chart title letter spacing -->
5386 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5387 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5388 <label for="ays-chart-option-title-text-decoration">
5389 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5390 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5391 <i class="ays_fa ays_fa_info_circle"></i>
5392 </a>
5393 </label>
5394 </div>
5395 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5396 <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]">
5397 <?php
5398 foreach ( $text_decorations as $option_slug => $option ):
5399 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5400 ?>
5401 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5402 <?php
5403 endforeach;
5404 ?>
5405 </select>
5406 </div>
5407 </div> <!-- Title text decoration -->
5408 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5409 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5410 <label for="ays-chart-option-title-text-shadow" class="form-label">
5411 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5412 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
5413 <i class="ays_fa ays_fa_info_circle"></i>
5414 </a>
5415 </label>
5416 </div>
5417 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5418 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5419 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-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); ?> >
5420 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5421 </label>
5422 </div>
5423 </div> <!-- Title bold -->
5424 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5425 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5426 <label for="ays-chart-option-title-shadow-color">
5427 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5428 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5429 <i class="ays_fa ays_fa_info_circle"></i>
5430 </a>
5431 </label>
5432 </div>
5433 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5434 <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) ?>">
5435 </div>
5436 </div> <!-- Chart title color -->
5437 </div>
5438 </div>
5439 <?php
5440 $content = ob_get_clean();
5441
5442 $title = __( 'Title', "chart-builder" );
5443
5444 $sources['title'] = array(
5445 'content' => $content,
5446 'title' => $title
5447 );
5448
5449 return $sources;
5450 }
5451
5452 public function settings_contents_description_styles_settings( $sources, $args ){
5453 $html_class_prefix = $args['html_class_prefix'];
5454 $html_name_prefix = $args['html_name_prefix'];
5455 $settings = $args['settings'];
5456
5457 $description_color = $settings['description_color'];
5458 $description_font_size = $settings['description_font_size'];
5459 $title_positions = $settings['title_positions'];
5460 $description_position = $settings['description_position'];
5461 $description_bold = $settings['description_bold'];
5462 $description_text_shadow = $settings['description_text_shadow'];
5463 $description_shadow_color = $settings['description_shadow_color'];
5464 $description_italic = $settings['description_italic'];
5465 $text_transforms = $settings['text_transforms'];
5466 $text_decorations = $settings['text_decorations'];
5467 $description_text_transform = $settings['description_text_transform'];
5468 $description_text_decoration = $settings['description_text_decoration'];
5469 $description_letter_spacing = $settings['description_letter_spacing'];
5470
5471 ob_start();
5472 ?>
5473 <div class="ays-accordion-data-main-wrap">
5474 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5475 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5476 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5477 <label for="ays-chart-option-description-color">
5478 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5479 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5480 <i class="ays_fa ays_fa_info_circle"></i>
5481 </a>
5482 </label>
5483 </div>
5484 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5485 <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) ?>">
5486 </div>
5487 </div> <!-- Chart description color -->
5488 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5489 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5490 <label for="ays-chart-option-description-font-size" class="form-label">
5491 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5492 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5493 <i class="ays_fa ays_fa_info_circle"></i>
5494 </a>
5495 </label>
5496 </div>
5497 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5498 <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) ?>">
5499 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5500 </div>
5501 </div> <!-- Chart description font size -->
5502 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5503 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5504 <label for="ays-chart-option-description-bold" class="form-label">
5505 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5506 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5507 <i class="ays_fa ays_fa_info_circle"></i>
5508 </a>
5509 </label>
5510 </div>
5511 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5512 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5513 <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); ?> >
5514 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5515 </label>
5516 </div>
5517 </div> <!-- Description bold -->
5518 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5519 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5520 <label for="ays-chart-option-description-italic" class="form-label">
5521 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5522 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5523 <i class="ays_fa ays_fa_info_circle"></i>
5524 </a>
5525 </label>
5526 </div>
5527 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5528 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5529 <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); ?> >
5530 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5531 </label>
5532 </div>
5533 </div> <!-- Description italic -->
5534 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5535 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5536 <label for="ays-chart-option-description-position">
5537 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5538 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5539 <i class="ays_fa ays_fa_info_circle"></i>
5540 </a>
5541 </label>
5542 </div>
5543 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5544 <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]">
5545 <?php
5546 foreach ( $title_positions as $option_slug => $option ):
5547 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5548 ?>
5549 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5550 <?php
5551 endforeach;
5552 ?>
5553 </select>
5554 </div>
5555 </div> <!-- Description position -->
5556 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5557 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5558 <label for="ays-chart-option-description-text-transform">
5559 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5560 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5561 <i class="ays_fa ays_fa_info_circle"></i>
5562 </a>
5563 </label>
5564 </div>
5565 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5566 <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]">
5567 <?php
5568 foreach ( $text_transforms as $option_slug => $option ):
5569 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5570 ?>
5571 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5572 <?php
5573 endforeach;
5574 ?>
5575 </select>
5576 </div>
5577 </div> <!-- description text transform -->
5578 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5579 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5580 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5581 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5582 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5583 <i class="ays_fa ays_fa_info_circle"></i>
5584 </a>
5585 </label>
5586 </div>
5587 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5588 <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) ?>">
5589 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5590 </div>
5591 </div> <!-- Chart description letter spacing -->
5592 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5593 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5594 <label for="ays-chart-option-description-text-decoration">
5595 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5596 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5597 <i class="ays_fa ays_fa_info_circle"></i>
5598 </a>
5599 </label>
5600 </div>
5601 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5602 <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]">
5603 <?php
5604 foreach ( $text_decorations as $option_slug => $option ):
5605 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5606 ?>
5607 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5608 <?php
5609 endforeach;
5610 ?>
5611 </select>
5612 </div>
5613 </div> <!-- description text decoration -->
5614 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5615 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5616 <label for="ays-chart-option-description-text-shadow" class="form-label">
5617 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5618 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
5619 <i class="ays_fa ays_fa_info_circle"></i>
5620 </a>
5621 </label>
5622 </div>
5623 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5624 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5625 <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); ?> >
5626 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5627 </label>
5628 </div>
5629 </div> <!-- description bold -->
5630 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5631 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5632 <label for="ays-chart-option-description-shadow-color">
5633 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5634 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart description.","chart-builder") ); ?>">
5635 <i class="ays_fa ays_fa_info_circle"></i>
5636 </a>
5637 </label>
5638 </div>
5639 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5640 <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) ?>">
5641 </div>
5642 </div> <!-- Chart title color -->
5643 </div>
5644 </div>
5645 <?php
5646 $content = ob_get_clean();
5647
5648 $title = __( 'Description', "chart-builder" );
5649
5650 $sources['description'] = array(
5651 'content' => $content,
5652 'title' => $title
5653 );
5654
5655 return $sources;
5656 }
5657
5658 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
5659 $html_class_prefix = $args['html_class_prefix'];
5660 $html_name_prefix = $args['html_name_prefix'];
5661 $settings = $args['settings'];
5662
5663 $description_color = $settings['description_color'];
5664 $description_font_size = $settings['description_font_size'];
5665 $title_positions = $settings['title_positions'];
5666 $description_position = $settings['description_position'];
5667 $description_bold = $settings['description_bold'];
5668 $description_text_shadow = $settings['description_text_shadow'];
5669 $description_shadow_color = $settings['description_shadow_color'];
5670 $description_italic = $settings['description_italic'];
5671 $text_transforms = $settings['text_transforms'];
5672 $text_decorations = $settings['text_decorations'];
5673 $description_text_transform = $settings['description_text_transform'];
5674 $description_text_decoration = $settings['description_text_decoration'];
5675 $description_letter_spacing = $settings['description_letter_spacing'];
5676
5677 ob_start();
5678 ?>
5679 <div class="ays-accordion-data-main-wrap">
5680 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5681 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5682 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5683 <label for="ays-chart-option-description-color">
5684 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5685 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5686 <i class="ays_fa ays_fa_info_circle"></i>
5687 </a>
5688 </label>
5689 </div>
5690 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5691 <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) ?>">
5692 </div>
5693 </div> <!-- Chart description color -->
5694 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5695 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5696 <label for="ays-chart-option-description-font-size" class="form-label">
5697 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5698 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5699 <i class="ays_fa ays_fa_info_circle"></i>
5700 </a>
5701 </label>
5702 </div>
5703 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5704 <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) ?>">
5705 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5706 </div>
5707 </div> <!-- Chart description font size -->
5708 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5709 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5710 <label for="ays-chart-option-description-bold" class="form-label">
5711 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5712 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5713 <i class="ays_fa ays_fa_info_circle"></i>
5714 </a>
5715 </label>
5716 </div>
5717 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5718 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5719 <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); ?> >
5720 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5721 </label>
5722 </div>
5723 </div> <!-- Description bold -->
5724 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5725 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5726 <label for="ays-chart-option-description-italic" class="form-label">
5727 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5728 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5729 <i class="ays_fa ays_fa_info_circle"></i>
5730 </a>
5731 </label>
5732 </div>
5733 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5734 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5735 <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); ?> >
5736 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5737 </label>
5738 </div>
5739 </div> <!-- Description italic -->
5740 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5741 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5742 <label for="ays-chart-option-description-position">
5743 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5744 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5745 <i class="ays_fa ays_fa_info_circle"></i>
5746 </a>
5747 </label>
5748 </div>
5749 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5750 <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]">
5751 <?php
5752 foreach ( $title_positions as $option_slug => $option ):
5753 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5754 ?>
5755 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5756 <?php
5757 endforeach;
5758 ?>
5759 </select>
5760 </div>
5761 </div> <!-- Description position -->
5762 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5763 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5764 <label for="ays-chart-option-description-text-transform">
5765 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5766 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5767 <i class="ays_fa ays_fa_info_circle"></i>
5768 </a>
5769 </label>
5770 </div>
5771 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5772 <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]">
5773 <?php
5774 foreach ( $text_transforms as $option_slug => $option ):
5775 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5776 ?>
5777 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5778 <?php
5779 endforeach;
5780 ?>
5781 </select>
5782 </div>
5783 </div> <!-- description text transform -->
5784 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5785 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5786 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5787 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5788 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5789 <i class="ays_fa ays_fa_info_circle"></i>
5790 </a>
5791 </label>
5792 </div>
5793 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5794 <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) ?>">
5795 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5796 </div>
5797 </div> <!-- Chart description letter spacing -->
5798 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5799 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5800 <label for="ays-chart-option-description-text-decoration">
5801 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5802 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5803 <i class="ays_fa ays_fa_info_circle"></i>
5804 </a>
5805 </label>
5806 </div>
5807 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5808 <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]">
5809 <?php
5810 foreach ( $text_decorations as $option_slug => $option ):
5811 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5812 ?>
5813 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5814 <?php
5815 endforeach;
5816 ?>
5817 </select>
5818 </div>
5819 </div> <!-- description text decoration -->
5820 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5821 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5822 <label for="ays-chart-option-description-text-shadow" class="form-label">
5823 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5824 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
5825 <i class="ays_fa ays_fa_info_circle"></i>
5826 </a>
5827 </label>
5828 </div>
5829 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5830 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5831 <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); ?> >
5832 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5833 </label>
5834 </div>
5835 </div> <!-- description bold -->
5836 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5837 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5838 <label for="ays-chart-option-description-shadow-color">
5839 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5840 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart description.","chart-builder") ); ?>">
5841 <i class="ays_fa ays_fa_info_circle"></i>
5842 </a>
5843 </label>
5844 </div>
5845 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5846 <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) ?>">
5847 </div>
5848 </div> <!-- Chart title color -->
5849 </div>
5850 </div>
5851 <?php
5852 $content = ob_get_clean();
5853
5854 $title = __( 'Description', "chart-builder" );
5855
5856 $sources['description'] = array(
5857 'content' => $content,
5858 'title' => $title
5859 );
5860
5861 return $sources;
5862 }
5863
5864 /**
5865 * Chart page settings contents
5866 * @param $args
5867 */
5868 public function ays_chart_page_advanced_settings_contents( $args ){
5869 $chart_source_type = $args['chart_source_type'];
5870
5871 if ($chart_source_type === 'chart-js') {
5872 if ($args['source_chart_type'] !== 'pie_chart') {return;}
5873 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
5874 } else {
5875 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
5876 }
5877
5878 $sources = array();
5879 foreach ( $sources_contents as $key => $sources_content ) {
5880 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
5881
5882 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
5883 if(isset($sources_content['title'])){
5884 $content .= '<legend class="ays-accordion-options-header">';
5885 $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">
5886 <g>
5887 <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" />
5888 </g>
5889 </svg>';
5890
5891 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
5892 }
5893
5894 $content .= '<div class="ays-accordion-options-content">';
5895 $content .= $sources_content['content'];
5896 $content .= '</div>';
5897
5898 $content .= '</fieldset>';
5899
5900 $sources[] = $content;
5901 }
5902 $content_for_escape = implode('' , $sources );
5903 echo html_entity_decode(esc_html( $content_for_escape ));
5904 }
5905
5906 public function settings_contents_advanced_settings( $sources, $args ){
5907 $html_class_prefix = $args['html_class_prefix'];
5908 $html_name_prefix = $args['html_name_prefix'];
5909 $settings = $args['settings'];
5910 $tab_title = $args['tab_name'];
5911
5912 $rotation_degree = $settings['rotation_degree'];
5913 $reverse_categories = $settings['reverse_categories'];
5914 $slice_border_color = $settings['slice_border_color'];
5915 $slice_texts = $settings['slice_texts'];
5916 $slice_text = $settings['slice_text'];
5917 $tooltip_text_options = $settings['tooltip_text_options'];
5918 $tooltip_text = $settings['tooltip_text'];
5919 $is_stacked = $settings['is_stacked'];
5920 $focus_target_options = $settings['focus_target_options'];
5921 $focus_target = $settings['focus_target'];
5922 $multiple_data_format_options = $settings['multiple_data_format_options'];
5923 $multiple_data_format = $settings['multiple_data_format'];
5924 $opacity = $settings['opacity'];
5925 $group_width = $settings['group_width'];
5926 $group_width_format = $settings['group_width_format'];
5927 $group_width_format_options = $settings['group_width_format_options'];
5928 $line_width = $settings['line_width'];
5929 $data_grouping_limit = $settings['data_grouping_limit'];
5930 $data_grouping_label = $settings['data_grouping_label'];
5931 $data_grouping_color = $settings['data_grouping_color'];
5932 $multiple_selection = $settings['multiple_selection'];
5933 $point_shape_options = $settings['point_shape_options'];
5934 $point_shape = $settings['point_shape'];
5935 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
5936 $crosshair_trigger = $settings['crosshair_trigger'];
5937 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
5938 $crosshair_orientation = $settings['crosshair_orientation'];
5939 $crosshair_opacity = $settings['crosshair_opacity'];
5940 $dash_style = $settings['dash_style'];
5941 $point_size = $settings['point_size'];
5942 $donut_hole_size = $settings['donut_hole_size'];
5943 $orientation = $settings['orientation'];
5944 $fill_nulls = $settings['fill_nulls'];
5945 $allow_collapse = $settings['allow_collapse'];
5946 $org_classname = $settings['org_classname'];
5947 $org_node_background_color = $settings['org_node_background_color'];
5948 $org_node_padding = $settings['org_node_padding'];
5949 $org_node_border_radius = $settings['org_node_border_radius'];
5950 $org_node_border_width = $settings['org_node_border_width'];
5951 $org_node_border_color = $settings['org_node_border_color'];
5952 $org_node_text_color = $settings['org_node_text_color'];
5953 $org_node_text_font_size = $settings['org_node_text_font_size'];
5954 $org_node_description_font_color = $settings['org_node_description_font_color'];
5955 $org_node_description_font_size = $settings['org_node_description_font_size'];
5956 $org_selected_classname = $settings['org_selected_classname'];
5957 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
5958 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
5959
5960 ob_start();
5961 ?>
5962 <div class="ays-accordion-data-main-wrap">
5963 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
5964 <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">
5965 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5966 <label for="ays-chart-option-rotation-degree" class="form-label">
5967 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
5968 <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") ); ?>">
5969 <i class="ays_fa ays_fa_info_circle"></i>
5970 </a>
5971 </label>
5972 </div>
5973 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5974 <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) ?>">
5975 </div>
5976 </div> <!-- Rotation degree -->
5977 <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">
5978 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5979 <label for="ays-chart-option-reverse-categories">
5980 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
5981 <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") ); ?>">
5982 <i class="ays_fa ays_fa_info_circle"></i>
5983 </a>
5984 </label>
5985 </div>
5986 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5987 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5988 <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); ?> >
5989 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5990 </label>
5991 </div>
5992 </div> <!-- Reverse Categories -->
5993 <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">
5994 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5995 <label for="ays-chart-option-slice-border-color">
5996 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
5997 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
5998 <i class="ays_fa ays_fa_info_circle"></i>
5999 </a>
6000 </label>
6001 </div>
6002 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6003 <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) ?>">
6004 </div>
6005 </div> <!-- Slice border color -->
6006 <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">
6007 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6008 <label for="ays-chart-option-slice-text">
6009 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6010 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the content of the text to be displayed on the pie slice.","chart-builder") ); ?>">
6011 <i class="ays_fa ays_fa_info_circle"></i>
6012 </a>
6013 </label>
6014 </div>
6015 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6016 <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]">
6017 <?php
6018 foreach ( $slice_texts as $option_slug => $option ):
6019 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6020 ?>
6021 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6022 <?php
6023 endforeach;
6024 ?>
6025 </select>
6026 </div>
6027 </div> <!-- Slice text -->
6028 <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">
6029 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6030 <label for="ays-chart-option-tooltip-text">
6031 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6032 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
6033 <i class="ays_fa ays_fa_info_circle"></i>
6034 </a>
6035 </label>
6036 </div>
6037 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6038 <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]">
6039 <?php
6040 foreach ( $tooltip_text_options as $option_slug => $option ):
6041 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6042 ?>
6043 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6044 <?php
6045 endforeach;
6046 ?>
6047 </select>
6048 </div>
6049 </div> <!-- Slice tooltip Text -->
6050 <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">
6051 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6052 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6053 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6054 <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") ); ?>">
6055 <i class="ays_fa ays_fa_info_circle"></i>
6056 </a>
6057 </label>
6058 </div>
6059 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6060 <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">
6061 </div>
6062 </div> <!-- Data Grouping Limit -->
6063 <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">
6064 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6065 <label for="ays-chart-option-data-grouping-label" class="form-label">
6066 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6067 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("A label for the combination slice that holds all slices below chart data grouping limit.","chart-builder") ); ?>">
6068 <i class="ays_fa ays_fa_info_circle"></i>
6069 </a>
6070 </label>
6071 </div>
6072 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6073 <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) ?>">
6074 </div>
6075 </div> <!-- Data Grouping Label -->
6076 <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">
6077 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6078 <label for="ays-chart-option-data-grouping-color">
6079 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6080 <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") ); ?>">
6081 <i class="ays_fa ays_fa_info_circle"></i>
6082 </a>
6083 </label>
6084 </div>
6085 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6086 <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) ?>">
6087 </div>
6088 </div> <!-- Data Grouping Color -->
6089 <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">
6090 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6091 <label for="ays-chart-option-is-stacked">
6092 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6093 <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") ); ?>">
6094 <i class="ays_fa ays_fa_info_circle"></i>
6095 </a>
6096 </label>
6097 </div>
6098 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6099 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6100 <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); ?> >
6101 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6102 </label>
6103 </div>
6104 </div> <!-- Is stacked -->
6105 <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">
6106 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6107 <label for="ays-chart-option-focus-target">
6108 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6109 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6110 echo htmlspecialchars( sprintf(
6111 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6112 __('%sSingle data:%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>" .
6113 __('%sGroup data:%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>",
6114 '<em>',
6115 '</em>',
6116 '<em>',
6117 '</em>'
6118 ) );
6119 ?>">
6120 <i class="ays_fa ays_fa_info_circle"></i>
6121 </a>
6122 </label>
6123 </div>
6124 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6125 <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]">
6126 <?php
6127 foreach ( $focus_target_options as $option_slug => $option ):
6128 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6129 ?>
6130 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6131 <?php
6132 endforeach;
6133 ?>
6134 </select>
6135 </div>
6136 </div> <!-- Focus target -->
6137 <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">
6138 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6139 <label for="ays-chart-option-opacity" class="form-label">
6140 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6141 <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") ); ?>">
6142 <i class="ays_fa ays_fa_info_circle"></i>
6143 </a>
6144 </label>
6145 </div>
6146 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6147 <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">
6148 </div>
6149 </div> <!-- Data opacity -->
6150 <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">
6151 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6152 <label for="ays-chart-option-group-width">
6153 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6154 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6155 echo htmlspecialchars( sprintf(
6156 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6157 __('%sPixels:%s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6158 __('%sPercentage:%s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6159 '<em>',
6160 '</em>',
6161 '<em>',
6162 '</em>'
6163 ) );
6164 ?>">
6165 <i class="ays_fa ays_fa_info_circle"></i>
6166 </a>
6167 </label>
6168 </div>
6169 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6170 <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) ?>">
6171 <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]">
6172 <?php
6173 foreach ( $group_width_format_options as $option_slug => $option ):
6174 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6175 ?>
6176 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6177 <?php
6178 endforeach;
6179 ?>
6180 </select>
6181 </div>
6182 </div> <!-- Bars width -->
6183 <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">
6184 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6185 <label for="ays-chart-option-line-width" class="form-label">
6186 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6187 <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") ); ?>">
6188 <i class="ays_fa ays_fa_info_circle"></i>
6189 </a>
6190 </label>
6191 </div>
6192 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6193 <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) ?>">
6194 </div>
6195 </div> <!-- Line width -->
6196 <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">
6197 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6198 <label for="ays-chart-option-multiple-selection">
6199 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6200 <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") ); ?>">
6201 <i class="ays_fa ays_fa_info_circle"></i>
6202 </a>
6203 </label>
6204 </div>
6205 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6206 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6207 <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); ?> >
6208 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6209 </label>
6210 </div>
6211 </div> <!-- Multiple data selection -->
6212 <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">
6213 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6214 <label for="ays-chart-option-multiple-data-format">
6215 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6216 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6217 echo htmlspecialchars( sprintf(
6218 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6219 __('%sCategory:%s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6220 __('%sSeries:%s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6221 __('%sAuto:%s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6222 __('%sNone:%s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6223 '<em>',
6224 '</em>',
6225 '<em>',
6226 '</em>',
6227 '<em>',
6228 '</em>',
6229 '<em>',
6230 '</em>'
6231 ) );
6232 ?>">
6233 <i class="ays_fa ays_fa_info_circle"></i>
6234 </a>
6235 </label>
6236 </div>
6237 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6238 <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]">
6239 <?php
6240 foreach ( $multiple_data_format_options as $option_slug => $option ):
6241 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6242 ?>
6243 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6244 <?php
6245 endforeach;
6246 ?>
6247 </select>
6248 </div>
6249 </div> <!-- Multiple data format -->
6250 <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">
6251 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6252 <label for="ays-chart-option-point-shape">
6253 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6254 <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") ); ?>">
6255 <i class="ays_fa ays_fa_info_circle"></i>
6256 </a>
6257 </label>
6258 </div>
6259 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6260 <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]">
6261 <?php
6262 foreach ( $point_shape_options as $option_slug => $option ):
6263 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6264 ?>
6265 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6266 <?php
6267 endforeach;
6268 ?>
6269 </select>
6270 </div>
6271 </div> <!-- Point shape -->
6272 <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">
6273 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6274 <label for="ays-chart-option-point-size" class="form-label">
6275 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6276 <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") ); ?>">
6277 <i class="ays_fa ays_fa_info_circle"></i>
6278 </a>
6279 </label>
6280 </div>
6281 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6282 <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) ?>">
6283 </div>
6284 </div> <!-- Point size -->
6285 <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">
6286 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6287 <label for="ays-chart-option-orientation">
6288 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6289 <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") ); ?>">
6290 <i class="ays_fa ays_fa_info_circle"></i>
6291 </a>
6292 </label>
6293 </div>
6294 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6295 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6296 <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); ?> >
6297 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6298 </label>
6299 </div>
6300 </div> <!-- Orientation -->
6301 <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">
6302 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6303 <label for="ays-chart-option-fill-nulls">
6304 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6305 <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") ); ?>">
6306 <i class="ays_fa ays_fa_info_circle"></i>
6307 </a>
6308 </label>
6309 </div>
6310 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6311 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6312 <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); ?> >
6313 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6314 </label>
6315 </div>
6316 </div> <!-- Autofill nulls -->
6317 <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">
6318 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6319 <label for="ays-chart-option-crosshair-trigger">
6320 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6321 <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") ); ?>">
6322 <i class="ays_fa ays_fa_info_circle"></i>
6323 </a>
6324 </label>
6325 </div>
6326 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6327 <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]">
6328 <?php
6329 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6330 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6331 ?>
6332 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6333 <?php
6334 endforeach;
6335 ?>
6336 </select>
6337 </div>
6338 </div> <!-- Crosshair trigger -->
6339 <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">
6340 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6341 <label for="ays-chart-option-crosshair-orientation">
6342 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6343 <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") ); ?>">
6344 <i class="ays_fa ays_fa_info_circle"></i>
6345 </a>
6346 </label>
6347 </div>
6348 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6349 <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]">
6350 <?php
6351 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6352 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6353 ?>
6354 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6355 <?php
6356 endforeach;
6357 ?>
6358 </select>
6359 </div>
6360 </div> <!-- Crosshair orientation -->
6361 <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">
6362 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6363 <label for="ays-chart-option-crosshair-opacity" class="form-label">
6364 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
6365 <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") ); ?>">
6366 <i class="ays_fa ays_fa_info_circle"></i>
6367 </a>
6368 </label>
6369 </div>
6370 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6371 <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">
6372 </div>
6373 </div> <!-- Crosshair opacity -->
6374 <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">
6375 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6376 <label for="ays-chart-option-dash-style" class="form-label">
6377 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
6378 <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") ); ?>">
6379 <i class="ays_fa ays_fa_info_circle"></i>
6380 </a>
6381 </label>
6382 </div>
6383 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6384 <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) ?>">
6385 </div>
6386 </div> <!-- Line dash pattern -->
6387 <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">
6388 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6389 <label for="ays-chart-option-donut-hole-size">
6390 <?php echo __( "Hole size", $this->plugin_name ); ?>
6391 </label>
6392 </div>
6393 <div class="col-sm-7 <?= $html_class_prefix ?>input-align-right <?= $html_class_prefix ?>option-input">
6394 <input class="ays-text-input form-control <?= $html_class_prefix ?>option-text-input" id="ays-chart-option-donut-hole-size" type="number" min="0" max="1" step=".1" name="<?php echo $html_name_prefix; ?>settings[donut_hole_size]" value="<?= $donut_hole_size ?>">
6395 </div>
6396 </div> <!-- Donut hole size -->
6397 <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">
6398 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6399 <div class="ays-pro-features-v2-video-button"></div>
6400 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6401 <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>
6402 <div class="ays-pro-features-v2-upgrade-text">
6403 <?php echo __("Upgrade" , "chart-builder"); ?>
6404 </div>
6405 </a>
6406 </div>
6407 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6408 <label for="ays-chart-option-curve-type">
6409 <?php echo __( "Line curve type", "chart-builder" ); ?>
6410 </label>
6411 </div>
6412 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6413 <select class="<?= $html_class_prefix ?>option-select-input form-select" id="ays-chart-option-line-curve-type" name="<?php echo $html_name_prefix; ?>settings[line_curve_type]">
6414 <option><?php echo __( "Straight", "chart-builder" ); ?></option>
6415 </select>
6416 </div>
6417 </div> <!-- Line curve type -->
6418 <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">
6419 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6420 <label for="ays-chart-option-allow-collapse">
6421 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
6422 <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") ); ?>">
6423 <i class="ays_fa ays_fa_info_circle"></i>
6424 </a>
6425 </label>
6426 </div>
6427 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6428 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6429 <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); ?> >
6430 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6431 </label>
6432 </div>
6433 </div> <!-- Allow collapse -->
6434 <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">
6435 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6436 <label for="ays-chart-option-org-node-description-font-color">
6437 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
6438 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
6439 <i class="ays_fa ays_fa_info_circle"></i>
6440 </a>
6441 </label>
6442 </div>
6443 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6444 <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) ?>">
6445 </div>
6446 </div> <!-- Org Node Description color -->
6447 <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">
6448 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6449 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
6450 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
6451 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
6452 <i class="ays_fa ays_fa_info_circle"></i>
6453 </a>
6454 </label>
6455 </div>
6456 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6457 <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) ?>">
6458 </div>
6459 </div> <!-- Org Node Description font size -->
6460 <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">
6461 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6462 <label for="ays-chart-option-org-classname" class="form-label">
6463 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
6464 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("A class name to assign to node elements to specify styles for the chart elements.","chart-builder") ); ?>">
6465 <i class="ays_fa ays_fa_info_circle"></i>
6466 </a>
6467 </label>
6468 </div>
6469 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6470 <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) ?>">
6471 </div>
6472 </div> <!-- Org custom class -->
6473 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6474 <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">
6475 <br>
6476 <blockquote>
6477 <?php echo sprintf(__( "%sNote:%s Custom CSS class must be set for the options below to take effect.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6478 </blockquote>
6479 <br>
6480 </div>
6481 <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">
6482 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6483 <label for="ays-chart-option-org-node-background-color">
6484 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6485 <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") ); ?>">
6486 <i class="ays_fa ays_fa_info_circle"></i>
6487 </a>
6488 </label>
6489 </div>
6490 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6491 <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) ?>">
6492 </div>
6493 </div> <!-- Org Node Background color -->
6494 <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">
6495 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6496 <label for="ays-chart-option-org-node-padding" class="form-label">
6497 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
6498 <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") ); ?>">
6499 <i class="ays_fa ays_fa_info_circle"></i>
6500 </a>
6501 </label>
6502 </div>
6503 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6504 <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) ?>">
6505 </div>
6506 </div> <!-- Org Node Padding -->
6507 <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">
6508 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6509 <label for="ays-chart-option-org-node-border-radius" class="form-label">
6510 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
6511 <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") ); ?>">
6512 <i class="ays_fa ays_fa_info_circle"></i>
6513 </a>
6514 </label>
6515 </div>
6516 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6517 <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) ?>">
6518 </div>
6519 </div> <!-- Org Node Border radius -->
6520 <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">
6521 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6522 <label for="ays-chart-option-org-node-border-width" class="form-label">
6523 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
6524 <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") ); ?>">
6525 <i class="ays_fa ays_fa_info_circle"></i>
6526 </a>
6527 </label>
6528 </div>
6529 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6530 <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) ?>">
6531 </div>
6532 </div> <!-- Org Node Border width -->
6533 <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">
6534 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6535 <label for="ays-chart-option-org-node-border-color">
6536 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
6537 <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") ); ?>">
6538 <i class="ays_fa ays_fa_info_circle"></i>
6539 </a>
6540 </label>
6541 </div>
6542 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6543 <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) ?>">
6544 </div>
6545 </div> <!-- Org Node Background color -->
6546 <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">
6547 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6548 <label for="ays-chart-option-org-node-text-color">
6549 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6550 <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") ); ?>">
6551 <i class="ays_fa ays_fa_info_circle"></i>
6552 </a>
6553 </label>
6554 </div>
6555 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6556 <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) ?>">
6557 </div>
6558 </div> <!-- Org Node Text color -->
6559 <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">
6560 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6561 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
6562 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
6563 <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") ); ?>">
6564 <i class="ays_fa ays_fa_info_circle"></i>
6565 </a>
6566 </label>
6567 </div>
6568 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6569 <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) ?>">
6570 </div>
6571 </div> <!-- Org Node Text font size -->
6572 </div> <!-- Org custom class options -->
6573 <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">
6574 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6575 <label for="ays-chart-option-org-selected-classname" class="form-label">
6576 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
6577 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("A class name to assign to node elements to specify styles for the selected chart elements.","chart-builder") ); ?>">
6578 <i class="ays_fa ays_fa_info_circle"></i>
6579 </a>
6580 </label>
6581 </div>
6582 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6583 <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) ?>">
6584 </div>
6585 </div> <!-- Org custom selected class -->
6586 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6587 <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">
6588 <br>
6589 <blockquote>
6590 <?php echo sprintf(__( "%sNote:%s Selected node custom CSS class must be set for the options below to take effect.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6591 </blockquote>
6592 <br>
6593 </div>
6594 <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">
6595 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6596 <label for="ays-chart-option-org-selected-node-background-color">
6597 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6598 <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") ); ?>">
6599 <i class="ays_fa ays_fa_info_circle"></i>
6600 </a>
6601 </label>
6602 </div>
6603 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6604 <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) ?>">
6605 </div>
6606 </div> <!-- Org selected Node Background color -->
6607 <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">
6608 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6609 <label for="ays-chart-option-org-selected-node-text-color">
6610 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6611 <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") ); ?>">
6612 <i class="ays_fa ays_fa_info_circle"></i>
6613 </a>
6614 </label>
6615 </div>
6616 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6617 <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) ?>">
6618 </div>
6619 </div> <!-- Org selected Node text color -->
6620 </div> <!-- Org custom selected class options -->
6621 </div>
6622 </div>
6623 <?php
6624 $content = ob_get_clean();
6625
6626 $sources['advanced_settings'] = array(
6627 'content' => $content,
6628 'title' => $tab_title
6629 );
6630
6631 return $sources;
6632 }
6633
6634 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
6635 $html_class_prefix = $args['html_class_prefix'];
6636 $html_name_prefix = $args['html_name_prefix'];
6637 $settings = $args['settings'];
6638 $tab_title = $args['tab_name'];
6639
6640 $outer_radius = $settings['outer_radius'];
6641 $slice_spacing = $settings['slice_spacing'];
6642 $circumference = $settings['circumference'];
6643 $start_angle = $settings['start_angle'];
6644 // $index_axis = $settings['index_axis'];
6645
6646 ob_start();
6647 ?>
6648 <div class="ays-accordion-data-main-wrap">
6649 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6650 <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">
6651 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6652 <label for="ays-chart-option-outer-radius" class="form-label">
6653 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
6654 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
6655 <i class="ays_fa ays_fa_info_circle"></i>
6656 </a>
6657 </label>
6658 </div>
6659 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6660 <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) ?>">
6661 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6662 </div>
6663 </div> <!-- Outer Radius -->
6664 <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">
6665 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6666 <label for="ays-chart-option-slice-spacing" class="form-label">
6667 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
6668 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
6669 <i class="ays_fa ays_fa_info_circle"></i>
6670 </a>
6671 </label>
6672 </div>
6673 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6674 <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) ?>">
6675 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6676 </div>
6677 </div> <!-- Slice Spacing -->
6678 <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">
6679 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6680 <label for="ays-chart-option-circumference" class="form-label">
6681 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
6682 <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") ); ?>">
6683 <i class="ays_fa ays_fa_info_circle"></i>
6684 </a>
6685 </label>
6686 </div>
6687 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6688 <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) ?>">
6689 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6690 </div>
6691 </div> <!-- Arc Coverage -->
6692 <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">
6693 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6694 <label for="ays-chart-option-start-angle" class="form-label">
6695 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
6696 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
6697 <i class="ays_fa ays_fa_info_circle"></i>
6698 </a>
6699 </label>
6700 </div>
6701 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6702 <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) ?>">
6703 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6704 </div>
6705 </div> <!-- Start Angle -->
6706 <!-- <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">
6707 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
6708 <label for="ays-chart-option-index-axis">
6709 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
6710 <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") ); ?>">
6711 <i class="ays_fa ays_fa_info_circle"></i>
6712 </a>
6713 </label>
6714 </div>
6715 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
6716 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6717 <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); ?> >
6718 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6719 </label>
6720 </div>
6721 </div> Reverse Categories -->
6722 </div>
6723 </div>
6724 <?php
6725 $content = ob_get_clean();
6726
6727 $sources['advanced_settings'] = array(
6728 'content' => $content,
6729 'title' => $tab_title
6730 );
6731
6732 return $sources;
6733 }
6734
6735 public function settings_contents_slices_settings( $sources, $args ){
6736 $html_class_prefix = $args['html_class_prefix'];
6737 $html_name_prefix = $args['html_name_prefix'];
6738 $settings = $args['settings'];
6739 $source = $args['source'];
6740 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6741 $source_chart_type = $args['source_chart_type'];
6742 $settings = $args['settings'];
6743 $title_row = array_shift($source);
6744
6745 if (isset($source) && !empty($source)) {
6746 if ( !isset( $source[0] ) ) {
6747 if (count($source[1]) > 2) {
6748 $titles = array();
6749 for ($i = 0; $i < count($source[1]); $i++) {
6750 array_push($titles, __("Title", $this->plugin_name).$i);
6751 }
6752 $source[0] = $titles;
6753 } else {
6754 $source[0] = array(
6755 __("Country", $this->plugin_name),
6756 __("Population", $this->plugin_name),
6757 );
6758 }
6759
6760 ksort($source);
6761 }
6762 }
6763
6764 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6765 foreach ($source as $key => $row) {
6766 $source[$key] = array_slice($row, 0, 2);
6767 }
6768 }
6769
6770 ob_start();
6771 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6772 $slice_color = $settings['slice_color'];
6773 $slice_colors_default = $settings['slice_colors_default'];
6774 $slice_offset = $settings['slice_offset'];
6775 $slice_text_color = $settings['slice_text_color'];
6776
6777 ?>
6778 <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">
6779 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6780 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
6781 <?php
6782 foreach ( $source as $key => $val ):
6783 ?>
6784 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
6785 <legend class="ays-slices-accordion-options-header">
6786 <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">
6787 <g>
6788 <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" />
6789 </g>
6790 </svg>
6791 <span><?php echo $val[0]; ?></span>
6792 </legend>
6793 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
6794 <div class="ays-slices-accordion-data-main-wrap">
6795 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6796 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6797 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6798 <label for="ays-chart-option-slice-color">
6799 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6800 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for this slice.","chart-builder") ); ?>">
6801 <i class="ays_fa ays_fa_info_circle"></i>
6802 </a>
6803 </label>
6804 </div>
6805 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6806 <input type="color"
6807 id="ays-chart-option-slice-color-<?php echo $key; ?>"
6808 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6809 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo $key; ?>]"
6810 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : $slice_colors_default[$key]; ?>"
6811 data-slice-id="<?php echo $key; ?>">
6812 </div>
6813 </div> <!-- Slice color -->
6814 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6815 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6816 <label for="ays-chart-option-slice-offset" class="form-label">
6817 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
6818 <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") ); ?>">
6819 <i class="ays_fa ays_fa_info_circle"></i>
6820 </a>
6821 </label>
6822 </div>
6823 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6824 <input type="number"
6825 id="ays-chart-option-slice-offset-<?php echo $key; ?>"
6826 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
6827 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo $key; ?>]"
6828 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
6829 data-slice-id="<?php echo $key; ?>"
6830 step=".01" min="0.0" max="1.0">
6831 </div>
6832 </div> <!-- Slice offset -->
6833 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6834 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6835 <label for="ays-chart-option-slice-text-color">
6836 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6837 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for the text of this slice.","chart-builder") ); ?>">
6838 <i class="ays_fa ays_fa_info_circle"></i>
6839 </a>
6840 </label>
6841 </div>
6842 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6843 <input type="color"
6844 id="ays-chart-option-slice-text-color-<?php echo $key; ?>"
6845 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6846 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo $key; ?>]"
6847 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
6848 data-slice-id="<?php echo $key; ?>">
6849 </div>
6850 </div> <!-- Slice color -->
6851 </div>
6852 </div>
6853 </div>
6854 </fieldset>
6855 <?php
6856 endforeach;
6857 ?>
6858 </div>
6859 </div>
6860 <br>
6861 <blockquote>
6862 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
6863 </blockquote>
6864 </div>
6865 <?php
6866
6867 } else {
6868 ?>
6869 <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>
6870 <?php
6871 }
6872
6873 $content = ob_get_clean();
6874
6875 $title = __( 'Slices settings', "chart-builder" );
6876
6877 $sources['slices_settings'] = array(
6878 'content' => $content,
6879 'title' => $title
6880 );
6881
6882 return $sources;
6883 }
6884
6885 public function settings_contents_series_settings( $sources, $args ){
6886 $html_class_prefix = $args['html_class_prefix'];
6887 $html_name_prefix = $args['html_name_prefix'];
6888 $settings = $args['settings'];
6889 $source = $args['source'];
6890 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6891 $source_chart_type = $args['source_chart_type'];
6892
6893 $line_width = $settings['line_width'];
6894 $point_size = $settings['point_size'];
6895 $point_shape_options = $settings['point_shape_options'];
6896 $point_shape = $settings['point_shape'];
6897
6898 if (isset($source) && !empty($source)) {
6899 if ( !isset( $source[0] ) ) {
6900 if (count($source[1]) > 2) {
6901 $titles = array();
6902 for ($i = 0; $i < count($source[1]); $i++) {
6903 array_push($titles, __("Title", $this->plugin_name).$i);
6904 }
6905 $source[0] = $titles;
6906 } else {
6907 $source[0] = array(
6908 __("Country", $this->plugin_name),
6909 __("Population", $this->plugin_name),
6910 );
6911 }
6912
6913 ksort($source);
6914 }
6915 }
6916
6917 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6918 foreach ($source as $key => $row) {
6919 $source[$key] = array_slice($row, 0, 2);
6920 }
6921 }
6922
6923 ob_start();
6924 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
6925 $series_row = array_shift($source);
6926 $title = array_shift($series_row);
6927 $series_color = $settings['series_color'];
6928 $series_colors_default = $settings['series_colors_default'];
6929 $series_visible_in_legend = $settings['series_visible_in_legend'];
6930 $series_line_width = $settings['series_line_width'];
6931 $series_point_size = $settings['series_point_size'];
6932 $series_point_shape = $settings['series_point_shape'];
6933
6934 ?>
6935 <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">
6936 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6937 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
6938 <?php
6939 foreach ( $series_row as $key => $val ):
6940 ?>
6941 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
6942 <legend class="ays-series-accordion-options-header">
6943 <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">
6944 <g>
6945 <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" />
6946 </g>
6947 </svg>
6948 <span><?php echo $val; ?></span>
6949 </legend>
6950 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
6951 <div class="ays-series-accordion-data-main-wrap">
6952 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6953 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6955 <label for="ays-chart-option-series-color">
6956 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6957 </label>
6958 </div>
6959 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6960 <input type="color"
6961 id="ays-chart-option-series-color-<?php echo $key; ?>"
6962 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6963 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo $key; ?>]"
6964 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : $series_colors_default[$key]; ?>"
6965 data-series-id="<?php echo $key; ?>">
6966 </div>
6967 </div> <!-- series color -->
6968 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6969 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6970 <label for="ays-chart-option-series-visible-in-legend">
6971 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
6972 <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") ); ?>">
6973 <i class="ays_fa ays_fa_info_circle"></i>
6974 </a>
6975 </label>
6976 </div>
6977 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6978 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6979 <input type="checkbox"
6980 id="ays-chart-option-series-visible-in-legend-<?php echo $key; ?>"
6981 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
6982 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo $key; ?>]"
6983 value="on"
6984 data-series-id="<?php echo $key; ?>"
6985 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
6986 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6987 </label>
6988 </div>
6989 </div> <!-- Series visible in legend -->
6990 <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">
6991 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6992 <label for="ays-chart-option-series-line-width">
6993 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6994 <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") ); ?>">
6995 <i class="ays_fa ays_fa_info_circle"></i>
6996 </a>
6997 </label>
6998 </div>
6999 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7000 <input type="number"
7001 id="ays-chart-option-series-line-width-<?php echo $key; ?>"
7002 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7003 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo $key; ?>]"
7004 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : $line_width; ?>"
7005 data-series-id="<?php echo $key; ?>">
7006 </div>
7007 </div> <!-- Line width -->
7008 <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">
7009 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7010 <label for="ays-chart-option-series-point-size">
7011 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7012 <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") ); ?>">
7013 <i class="ays_fa ays_fa_info_circle"></i>
7014 </a>
7015 </label>
7016 </div>
7017 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7018 <input type="number"
7019 id="ays-chart-option-series-point-size-<?php echo $key; ?>"
7020 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7021 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo $key; ?>]"
7022 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : $point_size; ?>"
7023 data-series-id="<?php echo $key; ?>">
7024 </div>
7025 </div> <!-- Point size -->
7026 <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">
7027 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7028 <label for="ays-chart-option-series-point-shape">
7029 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7030 <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") ); ?>">
7031 <i class="ays_fa ays_fa_info_circle"></i>
7032 </a>
7033 </label>
7034 </div>
7035 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7036 <select
7037 id="ays-chart-option-series-point-shape-<?php echo $key; ?>"
7038 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
7039 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo $key; ?>]"
7040 data-series-id="<?php echo $key; ?>">
7041 >
7042 <?php
7043 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
7044 foreach ( $point_shape_options as $option_slug => $option ):
7045 $selected = ( $value === $option_slug ) ? 'selected' : '';
7046 ?>
7047 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7048 <?php
7049 endforeach;
7050 ?>
7051 </select>
7052 </div>
7053 </div> <!-- Point shape -->
7054 </div>
7055 </div>
7056 </div>
7057 </fieldset>
7058 <?php
7059 endforeach;
7060 ?>
7061 </div>
7062 </div>
7063 <br>
7064 <blockquote>
7065 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7066 <br>
7067 <?php echo sprintf(__( "%sNote:%s If you are not able to set the options, disable the row settings feature.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7068 </blockquote>
7069 </div>
7070 <?php
7071
7072 } else {
7073 ?>
7074 <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>
7075 <?php
7076 }
7077
7078 $content = ob_get_clean();
7079
7080 $title = __( 'Series settings', "chart-builder" );
7081
7082 $sources['series_settings'] = array(
7083 'content' => $content,
7084 'title' => $title
7085 );
7086
7087 return $sources;
7088 }
7089
7090 public function settings_contents_row_settings( $sources, $args ){
7091 $html_class_prefix = $args['html_class_prefix'];
7092 $html_name_prefix = $args['html_name_prefix'];
7093 $settings = $args['settings'];
7094 $source = $args['source'];
7095 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7096 $source_chart_type = $args['source_chart_type'];
7097
7098 if (isset($source) && !empty($source)) {
7099 if ( !isset( $source[0] ) ) {
7100 if (count($source[1]) > 2) {
7101 $titles = array();
7102 for ($i = 0; $i < count($source[1]); $i++) {
7103 array_push($titles, __("Title", $this->plugin_name).$i);
7104 }
7105 $source[0] = $titles;
7106 } else {
7107 $source[0] = array(
7108 __("Country", $this->plugin_name),
7109 __("Population", $this->plugin_name),
7110 );
7111 }
7112
7113 ksort($source);
7114 }
7115 }
7116
7117 array_shift($source);
7118 $rows = array_column($source, 0);
7119
7120 $enable_row_settings = $settings['enable_row_settings'];
7121 $series_color = $settings['series_color'][0] ?? '#3366cc';
7122 $rows_color = $settings['rows_color'];
7123 $rows_opacity = $settings['rows_opacity'];
7124
7125 ob_start();
7126 ?>
7127 <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">
7128 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7129 <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">
7130 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7131 <label for="ays-chart-option-enable-row-settings">
7132 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7133 <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") ); ?>">
7134 <i class="ays_fa ays_fa_info_circle"></i>
7135 </a>
7136 </label>
7137 </div>
7138 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7139 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7140 <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); ?> >
7141 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7142 </label>
7143 </div>
7144 </div> <!-- Enable row settings -->
7145 <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'; ?>">
7146 <br>
7147 <?php
7148 foreach ( $rows as $key => $val ):
7149 ?>
7150 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7151 <legend class="ays-rows-accordion-options-header">
7152 <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">
7153 <g>
7154 <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" />
7155 </g>
7156 </svg>
7157 <span><?php echo $val; ?></span>
7158 </legend>
7159 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7160 <div class="ays-rows-accordion-data-main-wrap">
7161 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7162 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-rows-color">
7165 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7166 </label>
7167 </div>
7168 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7169 <input type="color"
7170 id="ays-chart-option-rows-color-<?php echo $key; ?>"
7171 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7172 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo $key; ?>]"
7173 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : $series_color; ?>"
7174 data-rows-id="<?php echo $key; ?>">
7175 </div>
7176 </div> <!-- color -->
7177 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7178 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7179 <label for="ays-chart-option-rows-color">
7180 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7181 </label>
7182 </div>
7183 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7184 <input type="number"
7185 id="ays-chart-option-rows-opacity-<?php echo $key; ?>"
7186 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7187 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo $key; ?>]"
7188 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7189 data-rows-id="<?php echo $key; ?>"
7190 step=".1" min="0" max="1">
7191 </div>
7192 </div> <!-- opacity -->
7193 </div>
7194 </div>
7195 </div>
7196 </fieldset>
7197 <?php
7198 endforeach;
7199 ?>
7200 <br>
7201 <blockquote>
7202 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7203 <br>
7204 <?php echo sprintf(__( "%sNote:%s The applied styles will work only if the chart has one column.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7205 </blockquote>
7206 </div>
7207 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7208 <br>
7209 <blockquote>
7210 <?php echo sprintf(__( "%sNote:%s If this option is disabled, the general options will be set from the series settings.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7211 </blockquote>
7212 </div>
7213 </div>
7214 </div>
7215 <?php
7216 $content = ob_get_clean();
7217
7218 $title = __( 'Row settings', "chart-builder" );
7219
7220 $sources['row_settings'] = array(
7221 'content' => $content,
7222 'title' => $title
7223 );
7224
7225 return $sources;
7226 }
7227 }
7228