PluginProbe
Chartify – WordPress Chart Plugin / 3.0.0
Chartify – WordPress Chart Plugin v3.0.0
3.8.0 3.7.9 3.7.8 3.7.7 3.7.6 3.7.5 trunk 1.0.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 All 83 releases
chart-builder / admin / class-chart-builder-admin.php

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

7,132 lines 511.1 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 }
766 }
767 }
768 }
769
770 public function ays_chart_dismiss_button(){
771
772 $data = array(
773 'status' => false,
774 );
775
776 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
777 if( (isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( $_REQUEST['_ajax_nonce'], $this->plugin_name . '-sale-banner' )) && current_user_can( 'manage_options' )){
778 update_option('ays_chart_sale_btn', 1);
779 update_option('ays_chart_sale_date', current_time( 'mysql' ));
780 $data['status'] = true;
781 }
782 }
783
784 ob_end_clean();
785 $ob_get_clean = ob_get_clean();
786 echo json_encode($data);
787 wp_die();
788
789 }
790
791 // 30% Sale Emma
792 public function ays_chart_sale_message_30_emma($ishmar){
793 if($ishmar == 0 ){
794 $content = array();
795 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
796 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
797
798 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
799 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
800
801 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
802 $content[] = '<div>
803 <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;">
804 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
805 </div>';
806 $content[] = '</div>';
807
808 $content[] = '<div style="font-size: 17px;">';
809 $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(CHART_BUILDER_ADMIN_URL) . '/images/icons/guarantee-new.png">';
810 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
811
812 $content[] = '</div>';
813
814
815
816 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
817
818 $content[] = '<form action="" method="POST">';
819 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
820 if( current_user_can( 'manage_options' ) ){
821 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
822 ">Dismiss ad</button>';
823 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
824 }
825 $content[] = '</div>';
826 $content[] = '</form>';
827
828 $content[] = '</div>';
829
830 $content[] = '</div>';
831
832 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
833
834 $content[] = '<div id="ays-chart-countdown-main-container">';
835 $content[] = '<div class="ays-chart-countdown-container">';
836
837 $content[] = '<div id="ays-chart-countdown">';
838
839 $content[] = '<div style="font-weight: 500;">';
840 $content[] = __( "Offer ends in:", "chart-builder" );
841 $content[] = '</div>';
842
843 $content[] = '<ul>';
844 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
845 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
846 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
847 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
848 $content[] = '</ul>';
849 $content[] = '</div>';
850
851 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
852 $content[] = '<span>🚀</span>';
853 $content[] = '<span>⌛</span>';
854 $content[] = '<span>🔥</span>';
855 $content[] = '<span>💣</span>';
856 $content[] = '</div>';
857
858 $content[] = '</div>';
859 $content[] = '</div>';
860
861 $content[] = '</div>';
862
863 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
864 $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>';
865 $content[] = '<span >One-time payment</span>';
866 $content[] = '</div>';
867 $content[] = '</div>';
868 $content[] = '</div>';
869
870 $content = implode( '', $content );
871 echo html_entity_decode(esc_html( $content ));
872 }
873 }
874
875 // Self 20% sale
876 public static function ays_chart_sale_message20($ishmar){
877 if($ishmar == 0 ){
878 $content = array();
879
880 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
881 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
882 // $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>';
883
884 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
885
886 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
887 $content[] = '<span class="ays-chart-new-chart-pro-title">';
888 $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 );
889 $content[] = '</span>';
890 $content[] = '<div>';
891 $content[] = '<img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-sale-30.svg" style="width: 70px;">';
892 $content[] = '</div>';
893 $content[] = '</div>';
894
895 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
896 $content[] = '<img class="ays-chart-new-chart-pro-guaranteeicon" src="' . CHART_BUILDER_ADMIN_URL . '/images/chart-builder-guaranteeicon.webp" style="width: 30px;">';
897 $content[] = __( "30 Days Money Back Guarantee", CHART_BUILDER_NAME );
898 $content[] = '</span>';
899
900 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
901 $content[] = '<form method="POST">';
902 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
903 if (current_user_can( 'manage_options' )) {
904 $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>';
905 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
906 }
907 $content[] = '</div>';
908 $content[] = '</form>';
909 $content[] = '</div>';
910
911 $content[] = '</div>';
912
913 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
914
915 $content[] = '<div id="ays-chart-countdown-main-container">';
916 $content[] = '<div class="ays-chart-countdown-container">';
917 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
918 $content[] = __( "Offer ends in:", CHART_BUILDER_NAME );
919
920 $content[] = '<ul style="padding: 0">';
921 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', CHART_BUILDER_NAME ) . '</li>';
922 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', CHART_BUILDER_NAME ) . '</li>';
923 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', CHART_BUILDER_NAME ) . '</li>';
924 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', CHART_BUILDER_NAME ) . '</li>';
925 $content[] = '</ul>';
926 $content[] = '</div>';
927
928 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
929 $content[] = '<span>🚀</span>';
930 $content[] = '<span>⌛</span>';
931 $content[] = '<span>🔥</span>';
932 $content[] = '<span>💣</span>';
933 $content[] = '</div>';
934 $content[] = '</div>';
935 $content[] = '</div>';
936
937 $content[] = '</div>';
938
939 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
940 $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>';
941 $content[] = '<span class="ays-chart-dicount-one-time-text">';
942 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
943 $content[] = '</span>';
944 $content[] = '</div>';
945
946 $content[] = '</div>';
947
948 $content[] = '</div>';
949
950 $content = implode( '', $content );
951 echo $content;
952 }
953 }
954
955 // Helloween banner
956 public static function ays_chart_helloween_message($ishmar){
957 if($ishmar == 0 ){
958 $content = array();
959
960 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
961 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
962 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
963
964 $content[] = '<p>';
965 $content[] = __( "Limited Time
966 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
967 <span>
968 SALE on
969 </span>
970 <br>
971 <span style='' class='ays-chart-helloween-bundle'>
972 <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;'>
973 Chart Builder
974 </a>
975 </span>", CHART_BUILDER_NAME );
976 $content[] = '</p>';
977 $content[] = '<p>';
978 $content[] = __( "Hurry up!
979 <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;'>
980 Check it out!
981 </a>", CHART_BUILDER_NAME );
982 $content[] = '</p>';
983
984 $content[] = '</div>';
985
986
987 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
988 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
989 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
990 $content[] = '<div class="ays-chart-countdown-container-helloween">';
991 $content[] = '<div id="ays-chart-countdown">';
992 $content[] = '<ul>';
993 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
994 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
995 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
996 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
997 $content[] = '</ul>';
998 $content[] = '</div>';
999
1000 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1001 $content[] = '<span>🚀</span>';
1002 $content[] = '<span>⌛</span>';
1003 $content[] = '<span>🔥</span>';
1004 $content[] = '<span>💣</span>';
1005 $content[] = '</div>';
1006
1007 $content[] = '</div>';
1008
1009 $content[] = '</div>';
1010
1011 $content[] = '</div>';
1012 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1013 $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>';
1014 $content[] = '</div>';
1015 $content[] = '</div>';
1016
1017 $content[] = '</div>';
1018
1019 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1020 $content[] = '<form method="POST">';
1021 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1022 if( current_user_can( 'manage_options' ) ){
1023 $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>';
1024 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1025 }
1026 $content[] = '</div>';
1027 $content[] = '</form>';
1028
1029 $content[] = '</div>';
1030 // $content[] = '<button type="button" class="notice-dismiss">';
1031 // $content[] = '</button>';
1032 $content[] = '</div>';
1033
1034 $content = implode( '', $content );
1035
1036 echo $content;
1037 }
1038 }
1039
1040 // Black Friday banner
1041 public static function ays_chart_black_friday_message($ishmar){
1042 if($ishmar == 0 ){
1043 $content = array();
1044
1045 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1046 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1047 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1048 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1049 $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>';
1050 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1051 $content[] = '</div>';
1052
1053 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1054 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1055 $content[] = '</div>';
1056
1057 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1058 $content[] = '<div id="ays-chart-countdown-main-container">';
1059 $content[] = '<div class="ays-chart-countdown-container">';
1060 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1061 $content[] = '<ul>';
1062 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1063 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1064 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1065 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1066 $content[] = '</ul>';
1067 $content[] = '</div>';
1068 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1069 $content[] = '<span>🚀</span>';
1070 $content[] = '<span>⌛</span>';
1071 $content[] = '<span>🔥</span>';
1072 $content[] = '<span>💣</span>';
1073 $content[] = '</div>';
1074 $content[] = '</div>';
1075 $content[] = '</div>';
1076 $content[] = '</div>';
1077
1078 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1079 $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>';
1080 $content[] = '</div>';
1081 $content[] = '</div>';
1082 $content[] = '</div>';
1083
1084 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1085 $content[] = '<form method="POST">';
1086 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1087 if( current_user_can( 'manage_options' ) ){
1088 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1089 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1090 }
1091 $content[] = '</div>';
1092 $content[] = '</form>';
1093 $content[] = '</div>';
1094 $content[] = '</div>';
1095
1096 $content = implode( '', $content );
1097
1098 echo $content;
1099 }
1100 }
1101
1102 // Christmas banner
1103 public static function ays_chart_christmas_message($ishmar){
1104 if($ishmar == 0 ){
1105 $content = array();
1106
1107 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1108 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1109 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1110 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1111 $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>';
1112 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', CHART_BUILDER_NAME ) . '</div>';
1113 $content[] = '</div>';
1114
1115 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1116 $content[] = '<div id="ays-chart-countdown-main-container">';
1117 $content[] = '<div class="ays-chart-countdown-container">';
1118 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1119 $content[] = '<ul>';
1120 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', CHART_BUILDER_NAME ) . '</li>';
1121 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', CHART_BUILDER_NAME ) . '</li>';
1122 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', CHART_BUILDER_NAME ) . '</li>';
1123 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', CHART_BUILDER_NAME ) . '</li>';
1124 $content[] = '</ul>';
1125 $content[] = '</div>';
1126 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1127 $content[] = '<span>🚀</span>';
1128 $content[] = '<span>⌛</span>';
1129 $content[] = '<span>🔥</span>';
1130 $content[] = '<span>💣</span>';
1131 $content[] = '</div>';
1132 $content[] = '</div>';
1133 $content[] = '</div>';
1134 $content[] = '</div>';
1135
1136 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1137 $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>';
1138 $content[] = '</div>';
1139 $content[] = '</div>';
1140 $content[] = '</div>';
1141
1142 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1143 $content[] = '<form method="POST">';
1144 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1145 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', CHART_BUILDER_NAME ) . '</button>';
1146 $content[] = '</div>';
1147 $content[] = '</form>';
1148 $content[] = '</div>';
1149 $content[] = '</div>';
1150
1151 $content = implode( '', $content );
1152
1153 echo $content;
1154 }
1155 }
1156
1157 // Silver Bundle
1158 public function ays_chart_silver_bundle_message($ishmar){
1159 if($ishmar == 0 ){
1160 $content = array();
1161
1162 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1163 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1164 $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>';
1165
1166 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1167
1168 $content[] = '<strong style="font-weight: bold;">';
1169 $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 );
1170 $content[] = '</strong>';
1171
1172 $content[] = '<br>';
1173
1174 $content[] = '<strong>';
1175 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", CHART_BUILDER_NAME );
1176 $content[] = '</strong>';
1177
1178 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1179
1180 $content[] = '<form method="POST">';
1181 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1182 $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>';
1183 $content[] = '</div>';
1184 $content[] = '</form>';
1185
1186 $content[] = '</div>';
1187
1188 $content[] = '</div>';
1189
1190 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1191
1192 $content[] = '<div id="ays-chart-countdown-main-container">';
1193 $content[] = '<div class="ays-chart-countdown-container">';
1194
1195 $content[] = '<div id="ays-chart-countdown">';
1196 $content[] = '<ul>';
1197 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1198 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1199 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1200 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1201 $content[] = '</ul>';
1202 $content[] = '</div>';
1203
1204 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1205 $content[] = '<span>🚀</span>';
1206 $content[] = '<span>⌛</span>';
1207 $content[] = '<span>🔥</span>';
1208 $content[] = '<span>💣</span>';
1209 $content[] = '</div>';
1210
1211 $content[] = '</div>';
1212 $content[] = '</div>';
1213
1214 $content[] = '</div>';
1215
1216 $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>';
1217 $content[] = '</div>';
1218 $content[] = '</div>';
1219
1220 $content = implode( '', $content );
1221 echo $content;
1222 }
1223 }
1224
1225 public function ays_chart_update_banner_time(){
1226
1227 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1228 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1229 $next_3_days = date('M d, Y H:i:s', $date);
1230
1231 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1232
1233 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1234 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1235 }
1236
1237 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1238
1239 $val = 60*60*24*0.5; // half day
1240 // $val = 60; // for testing | 1 min
1241
1242 $current_date = current_time( 'mysql' );
1243 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1244
1245 $days_diff = $date_diff / $val;
1246 if(intval($days_diff) > 0 ){
1247 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1248 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1249 }
1250
1251 return $get_ays_chart_banner_time;
1252 }
1253
1254 public function author_user_search() {
1255 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1256 $params = $_REQUEST['params'];
1257 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1258 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1259 $args = 'search=';
1260 if ($search !== null) {
1261 $args .= '*';
1262 $args .= $search;
1263 $args .= '*';
1264 }
1265
1266 $users = get_users($args);
1267
1268 $content_text = array(
1269 'results' => array()
1270 );
1271
1272 foreach ($users as $key => $value) {
1273 if ($checked !== null) {
1274 if ( !is_array( $checked ) ) {
1275 $checked2 = $checked;
1276 $checked = array();
1277 $checked[] = absint($checked2);
1278 }
1279 if (in_array($value->ID, $checked)) {
1280 continue;
1281 } else {
1282 $content_text['results'][] = array(
1283 'id' => $value->ID,
1284 'text' => $value->data->display_name,
1285 );
1286 }
1287 } else {
1288 $content_text['results'][] = array(
1289 'id' => $value->ID,
1290 'text' => $value->data->display_name,
1291 );
1292 }
1293 }
1294
1295 ob_end_clean();
1296 echo json_encode($content_text);
1297 wp_die();
1298 }
1299
1300 /**
1301 * Determine if the plugin/addon installations are allowed.
1302 *
1303 * @since 6.4.0.4
1304 *
1305 * @param string $type Should be `plugin` or `addon`.
1306 *
1307 * @return bool
1308 */
1309 public static function ays_chart_can_install( $type ) {
1310
1311 return self::ays_chart_can_do( 'install', $type );
1312 }
1313
1314 /**
1315 * Determine if the plugin/addon activations are allowed.
1316 *
1317 * @since 6.4.0.4
1318 *
1319 * @param string $type Should be `plugin` or `addon`.
1320 *
1321 * @return bool
1322 */
1323 public static function ays_chart_can_activate( $type ) {
1324
1325 return self::ays_chart_can_do( 'activate', $type );
1326 }
1327
1328 /**
1329 * Determine if the plugin/addon installations/activations are allowed.
1330 *
1331 * @since 6.4.0.4
1332 *
1333 * @param string $what Should be 'activate' or 'install'.
1334 * @param string $type Should be `plugin` or `addon`.
1335 *
1336 * @return bool
1337 */
1338 public static function ays_chart_can_do( $what, $type ) {
1339
1340 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1341 return false;
1342 }
1343
1344 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1345 return false;
1346 }
1347
1348 $capability = $what . '_plugins';
1349
1350 if ( ! current_user_can( $capability ) ) {
1351 return false;
1352 }
1353
1354 // Determine whether file modifications are allowed and it is activation permissions checking.
1355 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1356 return false;
1357 }
1358
1359 // All plugin checks are done.
1360 if ( $type === 'plugin' ) {
1361 return true;
1362 }
1363 return false;
1364 }
1365
1366 /**
1367 * Activate plugin.
1368 *
1369 * @since 1.0.0
1370 * @since 6.4.0.4 Updated the permissions checking.
1371 */
1372 public function ays_chart_activate_plugin() {
1373
1374 // Run a security check.
1375 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1376
1377 // Check for permissions.
1378 if ( ! current_user_can( 'activate_plugins' ) ) {
1379 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1380 }
1381
1382 $type = 'addon';
1383
1384 if ( isset( $_POST['plugin'] ) ) {
1385
1386 if ( ! empty( $_POST['type'] ) ) {
1387 $type = sanitize_key( $_POST['type'] );
1388 }
1389
1390 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1391 $activate = activate_plugins( $plugin );
1392
1393 if ( ! is_wp_error( $activate ) ) {
1394 if ( $type === 'plugin' ) {
1395 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1396 } else {
1397 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1398 }
1399 }
1400 }
1401
1402 if ( $type === 'plugin' ) {
1403 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1404 }
1405
1406 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1407 }
1408
1409 /**
1410 * Install addon.
1411 *
1412 * @since 1.0.0
1413 * @since 6.4.0.4 Updated the permissions checking.
1414 */
1415 public function ays_chart_install_plugin() {
1416
1417 // Run a security check.
1418 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1419
1420 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1421 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1422
1423 // Check if new installations are allowed.
1424 if ( ! self::ays_chart_can_install( $type ) ) {
1425 wp_send_json_error( $generic_error );
1426 }
1427
1428 $error = $type === 'plugin'
1429 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1430 : "";
1431
1432 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1433
1434 if ( empty( $plugin_url ) ) {
1435 wp_send_json_error( $error );
1436 }
1437
1438 // Prepare variables.
1439 $url = esc_url_raw(
1440 add_query_arg(
1441 [
1442 'page' => 'chart-builder-featured-plugins',
1443 ],
1444 admin_url( 'admin.php' )
1445 )
1446 );
1447
1448 ob_start();
1449 $creds = request_filesystem_credentials( $url, '', false, false, null );
1450
1451 // Hide the filesystem credentials form.
1452 ob_end_clean();
1453
1454 // Check for file system permissions.
1455 if ( $creds === false ) {
1456 wp_send_json_error( $error );
1457 }
1458
1459 if ( ! WP_Filesystem( $creds ) ) {
1460 wp_send_json_error( $error );
1461 }
1462
1463 /*
1464 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1465 */
1466 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1467 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1468 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1469
1470
1471 // Do not allow WordPress to search/download translations, as this will break JS output.
1472 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1473
1474 // Create the plugin upgrader with our custom skin.
1475 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1476
1477 // Error check.
1478 if ( ! method_exists( $installer, 'install' ) ) {
1479 wp_send_json_error( $error );
1480 }
1481
1482 $installer->install( $plugin_url );
1483
1484 // Flush the cache and return the newly installed plugin basename.
1485 wp_cache_flush();
1486
1487 $plugin_basename = $installer->plugin_info();
1488
1489 if ( empty( $plugin_basename ) ) {
1490 wp_send_json_error( $error );
1491 }
1492
1493 $result = array(
1494 'msg' => $generic_error,
1495 'is_activated' => false,
1496 'basename' => $plugin_basename,
1497 );
1498
1499 // Check for permissions.
1500 if ( ! current_user_can( 'activate_plugins' ) ) {
1501 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1502
1503 wp_send_json_success( $result );
1504 }
1505
1506 // Activate the plugin silently.
1507 $activated = activate_plugin( $plugin_basename );
1508 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1509
1510 if ( ! is_wp_error( $activated ) ) {
1511
1512 $result['is_activated'] = true;
1513 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1514
1515 wp_send_json_success( $result );
1516 }
1517
1518 // Fallback error just in case.
1519 wp_send_json_error( $result );
1520 }
1521
1522 /**
1523 * List of AM plugins that we propose to install.
1524 *
1525 * @since 6.4.0.4
1526 *
1527 * @return array
1528 */
1529 protected function get_am_plugins() {
1530 if ( !isset( $_SESSION ) ) {
1531 session_start();
1532 }
1533
1534 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1535
1536 $plugin_slug = array(
1537 'quiz-maker',
1538 'survey-maker',
1539 'poll-maker',
1540 'ays-popup-box',
1541 'secure-copy-content-protection',
1542 'gallery-photo-gallery',
1543 'ays-chatgpt-assistant',
1544 'easy-form',
1545 );
1546
1547 $plugin_url_arr = array();
1548 foreach ($plugin_slug as $key => $slug) {
1549 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1550 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1551 $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] ) : "";
1552 } else {
1553 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1554 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1555 if ( $latest_version != '' ) {
1556 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1557 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1558 }
1559 }
1560
1561 $plugin_url_arr[$slug] = $plugin_url;
1562 }
1563
1564 $plugins_array = array(
1565 'quiz-maker/quiz-maker.php' => array(
1566 'icon' => $images_url . 'icon-quiz-128x128.png',
1567 'name' => __( 'Quiz Maker', "easy-form" ),
1568 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', "easy-form" ),
1569 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', "easy-form" ),
1570 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1571 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1572 'url' => $plugin_url_arr['quiz-maker'],
1573 ),
1574 'survey-maker/survey-maker.php' => array(
1575 'icon' => $images_url . 'icon-survey-128x128.png',
1576 'name' => __( 'Survey Maker', 'chart-builder' ),
1577 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1578 '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' ),
1579 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1580 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1581 'url' => $plugin_url_arr['survey-maker'],
1582 ),
1583 'poll-maker/poll-maker-ays.php' => array(
1584 'icon' => $images_url . 'icon-poll-128x128.png',
1585 'name' => __( 'Poll Maker', 'chart-builder' ),
1586 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1587 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1588 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1589 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1590 'url' => $plugin_url_arr['poll-maker'],
1591 ),
1592 'ays-popup-box/ays-pb.php' => array(
1593 'icon' => $images_url . 'icon-popup-128x128.png',
1594 'name' => __( 'Popup Box', 'chart-builder' ),
1595 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1596 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1597 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1598 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1599 'url' => $plugin_url_arr['ays-popup-box'],
1600 ),
1601 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1602 'icon' => $images_url . 'icon-sccp-128x128.png',
1603 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1604 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1605 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1606 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1607 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1608 'url' => $plugin_url_arr['secure-copy-content-protection'],
1609 ),
1610 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1611 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1612 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1613 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1614 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1615 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1616 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1617 'url' => $plugin_url_arr['gallery-photo-gallery'],
1618 ),
1619 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1620 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1621 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1622 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
1623 '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' ),
1624 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
1625 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
1626 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
1627 ),
1628 'easy-form/easy-form.php' => array(
1629 'icon' => $images_url . 'icon-form-128x128.png',
1630 'name' => __( 'Easy Form', 'chart-builder' ),
1631 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
1632 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
1633 'wporg' => 'https://wordpress.org/plugins/easy-form/',
1634 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
1635 'url' => $plugin_url_arr['easy-form'],
1636 ),
1637 );
1638
1639 return $plugins_array;
1640 }
1641
1642 protected function ays_chart_get_latest_plugin_version( $slug ){
1643
1644 if ( is_null( $slug ) || empty($slug) ) {
1645 return "";
1646 }
1647
1648 $version_latest = "";
1649
1650 if ( ! function_exists( 'plugins_api' ) ) {
1651 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
1652 }
1653
1654 // set the arguments to get latest info from repository via API ##
1655 $args = array(
1656 'slug' => $slug,
1657 'fields' => array(
1658 'version' => true,
1659 )
1660 );
1661
1662 /** Prepare our query */
1663 $call_api = plugins_api( 'plugin_information', $args );
1664
1665 /** Check for Errors & Display the results */
1666 if ( is_wp_error( $call_api ) ) {
1667 $api_error = $call_api->get_error_message();
1668 } else {
1669
1670 //echo $call_api; // everything ##
1671 if ( ! empty( $call_api->version ) ) {
1672 $version_latest = $call_api->version;
1673 }
1674 }
1675
1676 return $version_latest;
1677 }
1678
1679 /**
1680 * Get AM plugin data to display in the Addons section of About tab.
1681 *
1682 * @since 6.4.0.4
1683 *
1684 * @param string $plugin Plugin slug.
1685 * @param array $details Plugin details.
1686 * @param array $all_plugins List of all plugins.
1687 *
1688 * @return array
1689 */
1690 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
1691
1692 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
1693 $show_pro = false;
1694
1695 $plugin_data = array();
1696
1697 if ( $have_pro ) {
1698 if ( array_key_exists( $plugin, $all_plugins ) ) {
1699 if ( is_plugin_active( $plugin ) ) {
1700 $show_pro = true;
1701 }
1702 }
1703 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
1704 $show_pro = true;
1705 }
1706 if ( $show_pro ) {
1707 $plugin = $details['pro']['plug'];
1708 $details = $details['pro'];
1709 }
1710 }
1711
1712 if ( array_key_exists( $plugin, $all_plugins ) ) {
1713 if ( is_plugin_active( $plugin ) ) {
1714 // Status text/status.
1715 $plugin_data['status_class'] = 'status-active';
1716 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
1717 // Button text/status.
1718 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
1719 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
1720 $plugin_data['plugin_src'] = esc_attr( $plugin );
1721 } else {
1722 // Status text/status.
1723 $plugin_data['status_class'] = 'status-installed';
1724 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
1725 // Button text/status.
1726 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1727 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
1728 $plugin_data['plugin_src'] = esc_attr( $plugin );
1729 }
1730 } else {
1731 // Doesn't exist, install.
1732 // Status text/status.
1733 $plugin_data['status_class'] = 'status-missing';
1734
1735 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
1736 $plugin_data['status_class'] = 'status-go-to-url';
1737 }
1738 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
1739 // Button text/status.
1740 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1741 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
1742 $plugin_data['plugin_src'] = esc_url( $details['url'] );
1743 }
1744
1745 $plugin_data['details'] = $details;
1746
1747 return $plugin_data;
1748 }
1749
1750 /**
1751 * Display the Addons section of About tab.
1752 *
1753 * @since 6.4.0.4
1754 */
1755 public function output_about_addons() {
1756
1757 if ( ! function_exists( 'get_plugins' ) ) {
1758 require_once ABSPATH . 'wp-admin/includes/plugin.php';
1759 }
1760
1761 $all_plugins = get_plugins();
1762 $am_plugins = $this->get_am_plugins();
1763 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
1764 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
1765
1766 $content = '';
1767 $content.= '<div class="ays-chart-cards-block">';
1768 foreach ( $am_plugins as $plugin => $details ){
1769
1770 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
1771 $plugin_ready_to_activate = $can_activate_plugins
1772 && isset( $plugin_data['status_class'] )
1773 && $plugin_data['status_class'] === 'status-installed';
1774 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
1775 || $plugin_data['status_class'] !== 'status-active';
1776
1777 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
1778
1779 $plugin_action_class_disbaled = "";
1780 if ( strpos($plugin_action_class, 'status-active') !== false ) {
1781 $plugin_action_class_disbaled = "disbaled='true'";
1782 }
1783
1784 $content .= '
1785 <div class="ays-chart-card">
1786 <div class="ays-chart-card__content flexible">
1787 <div class="ays-chart-card__content-img-box">
1788 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
1789 </div>
1790 <div class="ays-chart-card__text-block">
1791 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
1792 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
1793 <span class="ays-chart-card__text-hidden">
1794 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
1795 </span>
1796 </p>
1797 </div>
1798 </div>
1799 <div class="ays-chart-card__footer">';
1800 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
1801 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
1802 '. wp_kses_post( $plugin_data['action_text'] ) .'
1803 </button>';
1804 }
1805 elseif ( $plugin_not_activated ) {
1806 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
1807 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
1808 <span aria-hidden="true" class="dashicons dashicons-external"></span>
1809 </a>';
1810 }
1811 $content .='
1812 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', $this->plugin_name) .'</a>
1813 </div>
1814 </div>';
1815 }
1816 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
1817 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
1818 $content.= '</div>';
1819
1820 echo $content;
1821 }
1822
1823 /**
1824 * Returns the data from Quiz maker.
1825 *
1826 * @access public
1827 */
1828 public function fetch_quiz_maker_data(){
1829 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
1830
1831 $params = $_POST['params'];
1832 if ( !isset($params) || empty($params) ) {
1833 return array(
1834 'success' => false,
1835 'data' => array(
1836 'msg' => __( "Something went wrong.", "chart-builder" )
1837 )
1838 );
1839 }
1840
1841 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
1842 if ( $query == '' ) {
1843 return array(
1844 'success' => false,
1845 'data' => array(
1846 'msg' => __( "No data given.", "chart-builder" )
1847 )
1848 );
1849 }
1850 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
1851 $user_id = get_current_user_id();
1852
1853 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
1854
1855 if (empty($return_results)) {
1856 return array(
1857 'success' => false,
1858 'data' => array(
1859 'msg' => __( "Something went wrong.", "chart-builder" )
1860 )
1861 );
1862 }
1863
1864 $result_values = $return_results['result'];
1865 $query = $return_results['query'];
1866
1867 if (empty($result_values)) {
1868 return array(
1869 'success' => false,
1870 'data' => array(
1871 'msg' => $return_results['message']
1872 )
1873 );
1874 }
1875
1876 if (count($return_results['result'][0]) != 1 ) {
1877 $results = array();
1878 $headers = array();
1879 if ( $result_values ) {
1880 $row_num = 0;
1881 foreach ( $result_values as $row ) {
1882 $result = array();
1883 foreach ( $row as $k => $v ) {
1884 $result[] = $v;
1885 if ( $row_num === 0 ) {
1886 $headers[] = $k;
1887 }
1888 }
1889 $results[] = $result;
1890 $row_num++;
1891 }
1892 }
1893 } else if (count($return_results['result'][0]) == 1) {
1894 $results = array();
1895 $headers = array();
1896 if ( $result_values ) {
1897 $row_num = 0;
1898 foreach ( $result_values as $index => $row ) {
1899 $result = array();
1900 foreach ( $row as $k => $v ) {
1901 $result[] = strval($index) + 1;
1902 $result[] = $v;
1903 if ( $row_num === 0 ) {
1904 $headers[] = 'Quiz';
1905 $headers[] = $k;
1906 }
1907 }
1908 $results[] = $result;
1909 $row_num++;
1910 }
1911 }
1912 }
1913
1914 if (empty($results)) {
1915 return array(
1916 'success' => false,
1917 'data' => array(
1918 'msg' => $return_results['message']
1919 )
1920 );
1921 }
1922
1923 foreach ($results as $key => $value) {
1924 if (!isset($value) || count($value) <= 1 && $key != 0) {
1925 unset($results[$key]);
1926 }
1927 }
1928
1929 array_unshift($results, $headers);
1930 $results = array_values( $results );
1931 $data = $results;
1932
1933 $headers = $results[0];
1934 unset( $results[0] );
1935
1936 $html = CBFunctions()->get_table_html( $headers, $results );
1937
1938 return array(
1939 'success' => true,
1940 'data' => array(
1941 'table' => $html,
1942 'data' => $data
1943 )
1944 );
1945 }
1946
1947 /**
1948 * Saves the Quiz maker data.
1949 *
1950 * @access public
1951 */
1952 public function save_quiz_maker_data() {
1953 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
1954
1955 $params = $_POST['params'];
1956 if ( !isset($params) || empty($params) ) {
1957 return array(
1958 'success' => false,
1959 'data' => array(
1960 'msg' => __( "Something went wrong.", "chart-builder" )
1961 )
1962 );
1963 }
1964
1965 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
1966 if ( $query_id == '' ) {
1967 return array(
1968 'success' => false,
1969 'data' => array(
1970 'msg' => __( "No data given.", "chart-builder" )
1971 )
1972 );
1973 }
1974
1975 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
1976 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
1977 $user_id = get_current_user_id();
1978
1979 if ( $chart_id >= 0 ) {
1980
1981 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
1982
1983 if (empty($return_results)) {
1984 return array(
1985 'success' => false,
1986 'data' => array(
1987 'msg' => __( "Something went wrong.", "chart-builder" )
1988 )
1989 );
1990 }
1991
1992 $result_values = $return_results['result'];
1993 $query = $return_results['query'];
1994
1995 if (empty($result_values)) {
1996 return array(
1997 'success' => false,
1998 'data' => array(
1999 'msg' => $return_results['message']
2000 )
2001 );
2002 }
2003
2004 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2005 $results = array();
2006 $headers = array();
2007 if ( $result_values ) {
2008 $row_num = 0;
2009 foreach ( $result_values as $row ) {
2010 $result = array();
2011 foreach ( $row as $k => $v ) {
2012 $result[] = $v;
2013 if ( $row_num === 0 ) {
2014 $headers[] = $k;
2015 }
2016 }
2017 $results[] = $result;
2018 $row_num++;
2019 }
2020 }
2021 } else if (count($return_results['result'][0]) == 1) {
2022 $results = array();
2023 $headers = array();
2024 if ( $result_values ) {
2025 $row_num = 0;
2026 foreach ( $result_values as $index => $row ) {
2027 $result = array();
2028 foreach ( $row as $k => $v ) {
2029 $result[] = strval($index) + 1;
2030 $result[] = $v;
2031 if ( $row_num === 0 ) {
2032 $headers[] = 'Quiz';
2033 $headers[] = $k;
2034 }
2035 }
2036 $results[] = $result;
2037 $row_num++;
2038 }
2039 }
2040 }
2041
2042 $source_type = 'quiz_maker';
2043 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2044 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2045
2046 update_option( $option_name_for_data, array(
2047 'source_type' => $source_type,
2048 'source' => $query,
2049 'data' => $results,
2050 ) );
2051 update_option( $option_name_for_quiz, array(
2052 'quiz_query' => $query_id,
2053 'quiz_id' => $quiz_id
2054 ) );
2055
2056 } else {
2057 return array(
2058 'success' => false,
2059 'data' => array(
2060 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2061 )
2062 );
2063 }
2064
2065 return array(
2066 'success' => true,
2067 'data' => array(
2068 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2069 )
2070 );
2071 }
2072
2073 /**
2074 * Chart page action hooks
2075 */
2076
2077 /**
2078 * Chart page sources contents
2079 * @param $args
2080 */
2081 public function ays_chart_page_source_contents( $args ){
2082 $chart_source_type = $args['chart_source_type'];
2083
2084 if ($chart_source_type === 'chart-js') {
2085 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2086 } else {
2087 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2088 }
2089
2090 $source_type = $args['source_type'];
2091
2092 $sources = array();
2093 foreach ( $sources_contents as $key => $sources_content ) {
2094 $collapsed = $key == $source_type ? 'false' : 'true';
2095
2096 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2097 if( isset( $sources_content['title'] ) ){
2098 $content .= '<legend class="ays-accordion-options-header">';
2099 $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">
2100 <g>
2101 <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" />
2102 </g>
2103 </svg>';
2104
2105 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2106 }
2107
2108 $content .= '<div class="ays-accordion-options-content">';
2109 $content .= $sources_content['content'];
2110 $content .= '</div>';
2111
2112 $content .= '</fieldset>';
2113
2114 $sources[] = $content;
2115 }
2116 $content_for_escape = implode('' , $sources );
2117 echo html_entity_decode(esc_html( $content_for_escape ));
2118 }
2119
2120 public function source_contents_import_from_csv_settings( $sources, $args ){
2121 $html_class_prefix = $args['html_class_prefix'];
2122 $html_name_prefix = $args['html_name_prefix'];
2123
2124 ob_start();
2125 ?>
2126 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2127 <div class="ays-pro-features-v2-big-buttons-box">
2128 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2129 <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>
2130 <div class="ays-pro-features-v2-video-text">
2131 <?php echo __("Watch Video" , "chart-builder"); ?>
2132 </div>
2133 </a>
2134 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2135 <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>
2136 <div class="ays-pro-features-v2-upgrade-text">
2137 <?php echo __("Upgrade" , "chart-builder"); ?>
2138 </div>
2139 </a>
2140 </div>
2141 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2142 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2143 <h6><?php echo __("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2144 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2145 <option value="csv">CSV File</option>
2146 </select>
2147 <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>
2148 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2149 <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>
2150 </p>
2151 <div>
2152 <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" />
2153 </div>
2154 <div class='ays-chart-file-import-success'></div>
2155 <div class='ays-chart-file-import-error'></div>
2156 <div class="ays-chart-buttons-group">
2157 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2158 <?php echo __( 'Show Results', "chart-builder" ); ?>
2159 </button>
2160 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2161 <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>
2162 <?php echo __( 'Preview', "chart-builder" ); ?>
2163 </button>
2164 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2165 <?php echo __( 'Save data', "chart-builder" ); ?>
2166 </button>
2167 </div>
2168 </div>
2169 </div>
2170 </div>
2171 <?php
2172 $content = ob_get_clean();
2173
2174 $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") . '">
2175 <i class="ays_fa ays_fa_info_circle"></i>
2176 </a>';
2177
2178 $sources['file_import'] = array(
2179 'content' => $content,
2180 'title' => $title
2181 );
2182
2183 return $sources;
2184 }
2185
2186 public function source_contents_import_from_db_settings( $sources, $args ){
2187 $html_class_prefix = $args['html_class_prefix'];
2188 $html_name_prefix = $args['html_name_prefix'];
2189
2190 ob_start();
2191 ?>
2192 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2193 <div class="ays-pro-features-v2-big-buttons-box">
2194 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2195 <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>
2196 <div class="ays-pro-features-v2-video-text">
2197 <?php echo __("Watch Video" , "chart-builder"); ?>
2198 </div>
2199 </a>
2200 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2201 <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>
2202 <div class="ays-pro-features-v2-upgrade-text">
2203 <?php echo __("Upgrade" , "chart-builder"); ?>
2204 </div>
2205 </a>
2206 </div>
2207 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2208 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2209 <div id="ays-chart-db-query">
2210 <div class="<?= $html_class_prefix ?>-db-query-form">
2211 <div id="db-query-form">
2212 <input type="hidden" name="chart_id" value="1">
2213 <textarea name="query" class="<?= $html_class_prefix ?>db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2214 <div class='db-wizard-success'></div>
2215 <div class='db-wizard-error'></div>
2216 </div>
2217 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2218 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2219 <?php echo __( 'Show Results', "chart-builder" ); ?>
2220 </button>
2221 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2222 <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>
2223 <?php echo __( 'Preview', "chart-builder" ); ?>
2224 </button>
2225 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2226 <?php echo __( 'Save data', "chart-builder" ); ?>
2227 </button>
2228 </div>
2229 </div>
2230 <div class="db-wizard-hints">
2231 <ul>
2232 <!-- <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> -->
2233 <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>
2234 </ul>
2235 </div>
2236 </div>
2237 </div>
2238 </div>
2239 </div>
2240 <?php
2241 $content = ob_get_clean();
2242
2243 $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) . '">
2244 <i class="ays_fa ays_fa_info_circle"></i>
2245 </a>';
2246
2247 $sources['import_from_db'] = array(
2248 'content' => $content,
2249 'title' => $title
2250 );
2251
2252 return $sources;
2253 }
2254
2255 public function source_contents_import_from_external_db_settings( $sources, $args ){
2256 $html_class_prefix = $args['html_class_prefix'];
2257 $html_name_prefix = $args['html_name_prefix'];
2258
2259 ob_start();
2260 ?>
2261 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2262 <div class="ays-pro-features-v2-big-buttons-box">
2263 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2264 <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>
2265 <div class="ays-pro-features-v2-upgrade-text">
2266 <?php echo __("Upgrade" , "chart-builder"); ?>
2267 </div>
2268 </a>
2269 </div>
2270 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2271 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2272 <div class="form-group row mb-2">
2273 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2274 <label class="form-label">
2275 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2276 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2277 <i class="ays_fa ays_fa_info_circle"></i>
2278 </a>
2279 </label>
2280 </div>
2281 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2282 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2283 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2284 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2285 </label>
2286 </div>
2287 </div>
2288 <div id="ays-chart-external-db-query">
2289 <div class="<?= $html_class_prefix ?>-db-query-form">
2290 <div id="external-db-query-form">
2291 <input type="hidden" name="chart_id" value="1">
2292 <textarea name="query" class="<?= $html_class_prefix ?>external-db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2293 <div class='db-wizard-success'></div>
2294 <div class='db-wizard-error'></div>
2295 </div>
2296 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2297 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2298 <?php echo __( 'Show Results', "chart-builder" ); ?>
2299 </button>
2300 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2301 <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>
2302 <?php echo __( 'Preview', "chart-builder" ); ?>
2303 </button>
2304 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2305 <?php echo __( 'Save data', "chart-builder" ); ?>
2306 </button>
2307 </div>
2308 </div>
2309 <div class="db-wizard-hints">
2310 <ul>
2311 <!-- <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> -->
2312 <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>
2313 </ul>
2314 </div>
2315 </div>
2316 </div>
2317 </div>
2318 </div>
2319 <?php
2320 $content = ob_get_clean();
2321
2322 $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) . '">
2323 <i class="ays_fa ays_fa_info_circle"></i>
2324 </a>';
2325
2326 $sources['import_from_external_db'] = array(
2327 'content' => $content,
2328 'title' => $title
2329 );
2330
2331 return $sources;
2332 }
2333
2334 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2335 global $wpdb;
2336 $chart_id = $args['chart_id'];
2337 $html_class_prefix = $args['html_class_prefix'];
2338 $html_name_prefix = $args['html_name_prefix'];
2339 $source = $args['source'];
2340 $settings = $args['settings'];
2341 $quiz_queries = $args['quiz_queries'];
2342 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2343 $quiz_id = $args['quiz_id'];
2344 $quiz_query = $args['quiz_query'];
2345
2346 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2347 // $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") . '">
2348 // <i class="ays_fa ays_fa_info_circle"></i>
2349 // </a>', '<br>', '<b>', '</b>');
2350 // $content = $this->blockquote_content_quiz;
2351 // $sources['quiz_maker'] = array(
2352 // 'content' => $content,
2353 // 'title' => $title
2354 // );
2355
2356 return $sources;
2357 }
2358
2359 $sql = "SELECT `title`, `id` FROM " . $wpdb->prefix . "aysquiz_quizes WHERE `published` = 1 AND `question_ids` <> ''";
2360 $quizes = $wpdb->get_results($sql, "ARRAY_A");
2361
2362 ob_start();
2363 ?>
2364 <div class="ays-accordion-data-main-wrap">
2365 <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">
2366 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2367 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?= $chart_id ?>">
2368 <div class="<?= $html_class_prefix ?>select-quiz-maker-data-query-container" id="<?= $html_class_prefix ?>quiz-queries">
2369 <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 ) ?>">
2370 <i class="ays_fa ays_fa_info_circle"></i>
2371 </a>
2372 <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">
2373 <option value=""><?= __( "Select query", "chart-builder" ) ?></option>
2374 <?php foreach ( $quiz_queries as $id => $q):
2375 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2376 <option value="<?= $id ?>" <?= $quiz_query == $id ? 'selected' : '' ?> <?php echo 'is-pro="'.$disabled.'"'; ?>><?= $q ?></option>
2377 <?php endforeach; ?>
2378 </select>
2379 </div>
2380 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2381 <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">
2382 <option value="0"><?= __( "Select quiz", "chart-builder" ) ?></option>
2383 <?php foreach ( $quizes as $quiz): ?>
2384 <option value="<?= $quiz['id'] ?>" <?= $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?= $quiz['title'] ?></option>
2385 <?php endforeach; ?>
2386 </select>
2387 </div>
2388 <div id="ays-chart-quiz-maker-success"></div>
2389 <div id="ays-chart-quiz-maker-error"></div>
2390 <div class="ays-chart-buttons-group">
2391 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2392 <?php echo __( 'Show Results', "chart-builder" ); ?>
2393 </button>
2394 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2395 <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>
2396 <?php echo __( 'Preview', "chart-builder" ); ?>
2397 </button>
2398 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2399 <?php echo __( 'Save data', "chart-builder" ); ?>
2400 </button>
2401 </div>
2402 </div>
2403 <div>
2404 <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>
2405 </div>
2406 </div>
2407 </div>
2408 <?php
2409 $content = ob_get_clean();
2410
2411 $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) . '">
2412 <i class="ays_fa ays_fa_info_circle"></i>
2413 </a>', '<br>', '<b>', '</b>');
2414 $sources['quiz_maker'] = array(
2415 'content' => $content,
2416 'title' => $title
2417 );
2418
2419 return $sources;
2420 }
2421
2422 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2423 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2424 return $sources;
2425 }
2426
2427 $chart_id = $args['chart_id'];
2428 $html_class_prefix = $args['html_class_prefix'];
2429 $html_name_prefix = $args['html_name_prefix'];
2430 ob_start();
2431 ?>
2432 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2433 <div class="ays-pro-features-v2-big-buttons-box">
2434 <div class="ays-pro-features-v2-video-button"></div>
2435 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2436 <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>
2437 <div class="ays-pro-features-v2-upgrade-text">
2438 <?php echo __("Upgrade" , "chart-builder"); ?>
2439 </div>
2440 </a>
2441 </div>
2442 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2443 <div id="ays-chart-woocommerce-datas">
2444 <div class="<?= $html_class_prefix ?>woocommerce-datas-form">
2445 <div id="woocommerce-datas-form">
2446 <input type="hidden" name="chart_id" value="<?= $chart_id ?>">
2447 <div class="<?= $html_class_prefix ?>woocommerce-datas-query-container" id="<?= $html_class_prefix ?>woocommerce-datas-container-id" >
2448 <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 ) ?>">
2449 <i class="ays_fa ays_fa_info_circle"></i>
2450 </a>
2451 <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]">
2452 <option value=""><?= __( 'Select query', $this->plugin_name ) ?></option>
2453 </select>
2454 </div>
2455 <div class='ays-chart-woocommerce-datas-success'></div>
2456 <div class='ays-chart-woocommerce-datas-error'></div>
2457 </div>
2458 <div class="ays-chart-buttons-group">
2459 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2460 <?php echo __( 'Show Results', "chart-builder" ); ?>
2461 </button>
2462 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2463 <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>
2464 <?php echo __( 'Preview', "chart-builder" ); ?>
2465 </button>
2466 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2467 <?php echo __( 'Save data', "chart-builder" ); ?>
2468 </button>
2469 </div>
2470 </div>
2471 </div>
2472 </div>
2473 </div>
2474 <?php
2475 $content = ob_get_clean();
2476
2477 $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) . '">
2478 <i class="ays_fa ays_fa_info_circle"></i>
2479 </a>', '<br>', '<b>', '</b>');
2480 $sources['woocommerce'] = array(
2481 'content' => $content,
2482 'title' => $title
2483 );
2484
2485 return $sources;
2486 }
2487
2488 public function source_contents_manual_settings( $sources, $args ){
2489 $html_class_prefix = $args['html_class_prefix'];
2490 $html_name_prefix = $args['html_name_prefix'];
2491 $source = $args['source'];
2492 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2493 $settings = $args['settings'];
2494 $source_chart_type = $args['source_chart_type'];
2495 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2496
2497 if (isset($source) && !empty($source)) {
2498 if ( !isset( $source[0] ) ) {
2499 if (count($source[1]) > 2) {
2500 $titles = array();
2501 for ($i = 0; $i < count($source[1]); $i++) {
2502 array_push($titles, __("Title", $this->plugin_name).$i);
2503 }
2504 $source[0] = $titles;
2505 } else {
2506 $source[0] = array(
2507 __("Country", $this->plugin_name),
2508 __("Population", $this->plugin_name),
2509 );
2510 }
2511
2512 ksort($source);
2513 }
2514 }
2515
2516 if ($action == 'add') {
2517 foreach ($source as $key => $row) {
2518 $source[$key] = array_slice($row, 0, 2);
2519 }
2520 } else if ($action == 'edit') {
2521 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2522 foreach ($source as $key => $row) {
2523 $source[$key] = array_slice($row, 0, 2);
2524 }
2525 }
2526 }
2527 ob_start();
2528 ?>
2529 <div class="ays-accordion-data-main-wrap">
2530 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2531 <?php if($source_chart_type != 'org_chart'): ?>
2532 <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">
2533 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2534 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2535 </div> -->
2536 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2537 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2538 <?php if(!empty($source)):
2539 foreach($source as $source_id => $source_value):
2540 if(!empty($source_value) ):
2541 if ($source_id == 0): ?>
2542 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2543 <div class="ays-chart-empty-data-table-cell"></div>
2544 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2545 <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); ?>">
2546 <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">
2547 <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;" />
2548 </svg>
2549 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2550 <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'" : "" ?>>
2551 <?php if ($each_source_id !== 0): ?>
2552 <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">
2553 <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;" />
2554 </svg>
2555 <?php endif; ?>
2556 </div>
2557 </div>
2558 <?php endforeach; ?>
2559 </div>
2560 <?php else: ?>
2561 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2562 <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">
2563 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2564 <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;" />
2565 </svg>
2566 </div>
2567 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2568 <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">
2569 <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;" />
2570 </svg>
2571 </div>
2572 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2573 <?php if ($each_source_id == 0): ?>
2574 <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); ?>">
2575 <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)); ?>">
2576 </div>
2577 <?php else: ?>
2578 <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); ?>">
2579 <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">
2580 </div>
2581 <?php endif; ?>
2582 <?php endforeach; ?>
2583 </div>
2584 <?php endif; ?>
2585 <?php endif; ?>
2586 <?php endforeach; ?>
2587 <?php else:?>
2588 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2589 <div style="height: 63.11px; padding: 0 15px;"></div>
2590 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2591 <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">
2592 <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;" />
2593 </svg>
2594 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2595 <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'>
2596 <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">
2597 <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;" />
2598 </svg>
2599 </div>
2600 </div>
2601 </div>
2602 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2603 <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">
2604 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2605 <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" />
2606 </svg>
2607 </div>
2608 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2609 <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">
2610 <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;" />
2611 </svg>
2612 </div>
2613 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2614 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2615 </div>
2616 <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">
2617 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2618 </div>
2619 </div>
2620 <?php endif; ?>
2621 </div>
2622 <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">
2623 <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">
2624 <?php echo __( 'Add column', "chart-builder" ); ?>
2625 </div>
2626 </div>
2627 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2628 <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">
2629 <?php echo __( 'Add row', "chart-builder" ); ?>
2630 </div>
2631 <br>
2632 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2633 <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>
2634 <?php echo __( 'Preview', "chart-builder" ); ?>
2635 </button>
2636 </div>
2637 <?php endif; ?>
2638 <div class="<?= $html_class_prefix ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
2639 <div class="<?= $html_class_prefix ?>chart-source-data-content-org-type">
2640 <ul id="<?= $html_class_prefix ?>chart-source-data-edit-tree-content">
2641 </ul>
2642 </div>
2643 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2644 <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>
2645 <?php echo __( 'Preview', "chart-builder" ); ?>
2646 </button>
2647 </div>
2648 </div>
2649 </div>
2650 <?php
2651 $content = ob_get_clean();
2652
2653 $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") . '">
2654 <i class="ays_fa ays_fa_info_circle"></i>
2655 </a>';
2656
2657 $sources['manual'] = array(
2658 'content' => $content,
2659 'title' => $title
2660 );
2661
2662 return $sources;
2663 }
2664
2665 public function source_contents_manual_settings_chartjs( $sources, $args ){
2666 $html_class_prefix = $args['html_class_prefix'];
2667 $html_name_prefix = $args['html_name_prefix'];
2668 $source = $args['source'];
2669 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2670 $settings = $args['settings'];
2671 $source_chart_type = $args['source_chart_type'];
2672 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2673
2674 ob_start();
2675 ?>
2676 <div class="ays-accordion-data-main-wrap">
2677 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2678 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?= $html_class_prefix ?>chart-source-data-manual">
2679 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2680 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2681 <?php if(!empty($source)):
2682 foreach($source as $source_id => $source_value):
2683 if(!empty($source_value) ):
2684 if ($source_id == 0): ?>
2685 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2686 <div class="ays-chart-empty-data-table-cell"></div>
2687 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2688 <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); ?>">
2689 <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">
2690 <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;" />
2691 </svg>
2692 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2693 <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'" : "" ?>>
2694 <?php if ($each_source_id !== 0): ?>
2695 <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">
2696 <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;" />
2697 </svg>
2698 <?php endif; ?>
2699 </div>
2700 </div>
2701 <?php endforeach; ?>
2702 </div>
2703 <?php else: ?>
2704 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2705 <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">
2706 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2707 <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;" />
2708 </svg>
2709 </div>
2710 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2711 <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">
2712 <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;" />
2713 </svg>
2714 </div>
2715 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2716 <?php if ($each_source_id == 0): ?>
2717 <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); ?>">
2718 <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)); ?>">
2719 </div>
2720 <?php else: ?>
2721 <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); ?>">
2722 <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">
2723 </div>
2724 <?php endif; ?>
2725 <?php endforeach; ?>
2726 </div>
2727 <?php endif; ?>
2728 <?php endif; ?>
2729 <?php endforeach; ?>
2730 <?php else:?>
2731 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2732 <div style="height: 63.11px; padding: 0 15px;"></div>
2733 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2734 <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">
2735 <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;" />
2736 </svg>
2737 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2738 <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'>
2739 <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">
2740 <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;" />
2741 </svg>
2742 </div>
2743 </div>
2744 </div>
2745 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2746 <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">
2747 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2748 <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" />
2749 </svg>
2750 </div>
2751 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2752 <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">
2753 <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;" />
2754 </svg>
2755 </div>
2756 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2757 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2758 </div>
2759 <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">
2760 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2761 </div>
2762 </div>
2763 <?php endif; ?>
2764 </div>
2765 <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">
2766 <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">
2767 <?php echo __( 'Add column', "chart-builder" ); ?>
2768 </div>
2769 </div>
2770 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2771 <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">
2772 <?php echo __( 'Add row', "chart-builder" ); ?>
2773 </div>
2774 <br>
2775 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2776 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2777 <?php echo __( 'Preview', "chart-builder" ); ?>
2778 </button>
2779 </div>
2780 </div>
2781 </div>
2782 <?php
2783 $content = ob_get_clean();
2784
2785 $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") . '">
2786 <i class="ays_fa ays_fa_info_circle"></i>
2787 </a>';
2788
2789 $sources['manual'] = array(
2790 'content' => $content,
2791 'title' => $title
2792 );
2793
2794 return $sources;
2795 }
2796
2797 /**
2798 * Chart page settings contents
2799 * @param $args
2800 */
2801 public function ays_chart_page_settings_contents( $args ){
2802 $chart_source_type = $args['chart_source_type'];
2803
2804 if ($chart_source_type === 'chart-js') {
2805 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
2806 } else {
2807 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
2808 }
2809
2810 $sources = array();
2811 foreach ( $sources_contents as $key => $sources_content ) {
2812 $collapsed = $key == 'general_settings' ? 'false' : 'true';
2813
2814 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
2815 if(isset($sources_content['title'])){
2816 $content .= '<legend class="ays-accordion-options-header">';
2817 $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">
2818 <g>
2819 <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" />
2820 </g>
2821 </svg>';
2822
2823 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
2824 }
2825
2826 $content .= '<div class="ays-accordion-options-content">';
2827 $content .= $sources_content['content'];
2828 $content .= '</div>';
2829
2830 $content .= '</fieldset>';
2831
2832 $sources[] = $content;
2833 }
2834 $content_for_escape = implode('' , $sources );
2835 echo html_entity_decode(esc_html( $content_for_escape ));
2836 }
2837
2838 public function settings_contents_general_settings( $sources, $args ){
2839 $html_class_prefix = $args['html_class_prefix'];
2840 $html_name_prefix = $args['html_name_prefix'];
2841 $chart_description = $args['chart_description'];
2842 $create_author_data = $args['create_author_data'];
2843 $status = $args['status'];
2844 $settings = $args['settings'];
2845
2846 $show_title = $settings['show_title'];
2847 $show_description = $settings['show_description'];
2848 $enable_interactivity = $settings['enable_interactivity'];
2849 $maximized_view = $settings['maximized_view'];
2850
2851 ob_start();
2852 ?>
2853 <div class="ays-accordion-data-main-wrap">
2854 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
2855 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2856 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2857 <label for="ays-status" class="form-label">
2858 <?php echo esc_html(__('Status', "chart-builder")); ?>
2859 <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") ); ?>">
2860 <i class="ays_fa ays_fa_info_circle"></i>
2861 </a>
2862 </label>
2863 </div>
2864 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2865 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2866 <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' : ''; ?> >
2867 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2868 </label>
2869 </div>
2870 </div> <!-- Status -->
2871 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2872 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
2873 <label for="ays-chart-description" class="form-label">
2874 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
2875 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
2876 <i class="ays_fa ays_fa_info_circle"></i>
2877 </a>
2878 </label>
2879 </div>
2880 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
2881 <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>
2882 </div>
2883 </div> <!-- Chart description -->
2884 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2885 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
2886 <label for="ays-chart-create-author" class="form-label">
2887 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
2888 <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")); ?>">
2889 <i class="ays_fa ays_fa_info_circle"></i>
2890 </a>
2891 </label>
2892 </div>
2893 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
2894 <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">
2895 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
2896 <?php if (isset($create_author_data['ID'])) : ?>
2897 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
2898 <?php endif; ?>
2899 </select>
2900 </div>
2901 </div> <!-- Change chart author -->
2902 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2903 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2904 <label for="ays-chart-show-title" class="form-label">
2905 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
2906 <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") ); ?>">
2907 <i class="ays_fa ays_fa_info_circle"></i>
2908 </a>
2909 </label>
2910 </div>
2911 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2912 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2913 <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); ?> >
2914 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2915 </label>
2916 </div>
2917 </div> <!-- Show title -->
2918 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2919 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2920 <label for="ays-chart-show-description" class="form-label">
2921 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
2922 <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") ); ?>">
2923 <i class="ays_fa ays_fa_info_circle"></i>
2924 </a>
2925 </label>
2926 </div>
2927 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2928 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2929 <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); ?> >
2930 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2931 </label>
2932 </div>
2933 </div> <!-- Show description -->
2934 <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">
2935 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2936 <label for="ays-chart-option-enable-interactivity" class="form-label">
2937 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
2938 <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") ); ?>">
2939 <i class="ays_fa ays_fa_info_circle"></i>
2940 </a>
2941 </label>
2942 </div>
2943 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2944 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2945 <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); ?> >
2946 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2947 </label>
2948 </div>
2949 </div> <!-- Enable interactivity -->
2950 <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">
2951 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2952 <label for="ays-chart-option-maximized-view" class="form-label">
2953 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
2954 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
2955 <i class="ays_fa ays_fa_info_circle"></i>
2956 </a>
2957 </label>
2958 </div>
2959 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2960 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2961 <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); ?> >
2962 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2963 </label>
2964 </div>
2965 </div> <!-- Maximized view -->
2966 </div>
2967 </div>
2968 <?php
2969 $content = ob_get_clean();
2970
2971 $title = __( 'General Settings', "chart-builder" );
2972
2973 $sources['general_settings'] = array(
2974 'content' => $content,
2975 'title' => $title
2976 );
2977
2978 return $sources;
2979 }
2980
2981 public function settings_contents_general_settings_chartjs( $sources, $args ){
2982 $html_class_prefix = $args['html_class_prefix'];
2983 $html_name_prefix = $args['html_name_prefix'];
2984 $chart_description = $args['chart_description'];
2985 $create_author_data = $args['create_author_data'];
2986 $status = $args['status'];
2987 $settings = $args['settings'];
2988
2989 $show_title = $settings['show_title'];
2990 $show_description = $settings['show_description'];
2991
2992 ob_start();
2993 ?>
2994 <div class="ays-accordion-data-main-wrap">
2995 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
2996 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2997 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2998 <label for="ays-status" class="form-label">
2999 <?php echo esc_html(__('Status', "chart-builder")); ?>
3000 <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") ); ?>">
3001 <i class="ays_fa ays_fa_info_circle"></i>
3002 </a>
3003 </label>
3004 </div>
3005 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3006 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3007 <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' : ''; ?> >
3008 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3009 </label>
3010 </div>
3011 </div> <!-- Status -->
3012 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3013 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3014 <label for="ays-chart-description" class="form-label">
3015 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3016 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3017 <i class="ays_fa ays_fa_info_circle"></i>
3018 </a>
3019 </label>
3020 </div>
3021 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3022 <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>
3023 </div>
3024 </div> <!-- Chart description -->
3025 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3026 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3027 <label for="ays-chart-create-author" class="form-label">
3028 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3029 <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")); ?>">
3030 <i class="ays_fa ays_fa_info_circle"></i>
3031 </a>
3032 </label>
3033 </div>
3034 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3035 <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">
3036 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3037 <?php if (isset($create_author_data['ID'])) : ?>
3038 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3039 <?php endif; ?>
3040 </select>
3041 </div>
3042 </div> <!-- Change chart author -->
3043 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3044 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3045 <label for="ays-chart-show-title" class="form-label">
3046 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3047 <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") ); ?>">
3048 <i class="ays_fa ays_fa_info_circle"></i>
3049 </a>
3050 </label>
3051 </div>
3052 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3053 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3054 <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); ?> >
3055 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3056 </label>
3057 </div>
3058 </div> <!-- Show title -->
3059 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3060 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3061 <label for="ays-chart-show-description" class="form-label">
3062 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3063 <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") ); ?>">
3064 <i class="ays_fa ays_fa_info_circle"></i>
3065 </a>
3066 </label>
3067 </div>
3068 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3069 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3070 <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); ?> >
3071 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3072 </label>
3073 </div>
3074 </div> <!-- Show description -->
3075 </div>
3076 </div>
3077 <?php
3078 $content = ob_get_clean();
3079
3080 $title = __( 'General Settings', "chart-builder" );
3081
3082 $sources['general_settings'] = array(
3083 'content' => $content,
3084 'title' => $title
3085 );
3086
3087 return $sources;
3088 }
3089
3090 public function settings_contents_tooltip_settings( $sources, $args ){
3091 $html_class_prefix = $args['html_class_prefix'];
3092 $html_name_prefix = $args['html_name_prefix'];
3093 $settings = $args['settings'];
3094
3095 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3096 $tooltip_trigger = $settings['tooltip_trigger'];
3097 $show_color_code = $settings['show_color_code'];
3098 $tooltip_italic = $settings['tooltip_italic'];
3099 $tooltip_bold = $settings['tooltip_bold'];
3100 $tooltip_bold_options = $settings['tooltip_bold_options'];
3101 $tooltip_text_color = $settings['tooltip_text_color'];
3102 $tooltip_font_size = $settings['tooltip_font_size'];
3103
3104 ob_start();
3105 ?>
3106 <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">
3107 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
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-option-tooltip-trigger">
3111 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3112 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","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 <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]">
3119 <?php
3120 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3121 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3122 ?>
3123 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3124 <?php
3125 endforeach;
3126 ?>
3127 </select>
3128 </div>
3129 </div> <!-- Trigger -->
3130 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3131 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3132 <label for="ays-chart-option-show-color-code">
3133 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3134 <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") ); ?>">
3135 <i class="ays_fa ays_fa_info_circle"></i>
3136 </a>
3137 </label>
3138 </div>
3139 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3140 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3141 <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); ?> >
3142 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3143 </label>
3144 </div>
3145 </div> <!-- Show Color Code -->
3146 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3147 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3148 <label for="ays-chart-option-tooltip-text-color">
3149 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3150 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3151 <i class="ays_fa ays_fa_info_circle"></i>
3152 </a>
3153 </label>
3154 </div>
3155 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3156 <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) ?>">
3157 </div>
3158 </div> <!-- Text color -->
3159 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3160 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3161 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3162 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3163 <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") ); ?>">
3164 <i class="ays_fa ays_fa_info_circle"></i>
3165 </a>
3166 </label>
3167 </div>
3168 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3169 <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) ?>">
3170 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3171 </div>
3172 </div> <!-- Font size -->
3173 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3174 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3175 <label for="ays-chart-option-tooltip-italic">
3176 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3177 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3178 <i class="ays_fa ays_fa_info_circle"></i>
3179 </a>
3180 </label>
3181 </div>
3182 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3183 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3184 <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); ?> >
3185 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3186 </label>
3187 </div>
3188 </div> <!-- Italic text -->
3189 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3190 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3191 <label for="ays-chart-option-tooltip-bold">
3192 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3193 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3194 <i class="ays_fa ays_fa_info_circle"></i>
3195 </a>
3196 </label>
3197 </div>
3198 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3199 <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]">
3200 <?php
3201 foreach ( $tooltip_bold_options as $option_slug => $option ):
3202 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3203 ?>
3204 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3205 <?php
3206 endforeach;
3207 ?>
3208 </select>
3209 </div>
3210 </div> <!-- Bold text -->
3211 </div>
3212 </div>
3213 <?php
3214 $content = ob_get_clean();
3215
3216 $title = __( 'Tooltip', "chart-builder" );
3217
3218 $sources['tooltip'] = array(
3219 'content' => $content,
3220 'title' => $title
3221 );
3222
3223 return $sources;
3224 }
3225
3226 public function settings_contents_legend_settings( $sources, $args ){
3227 $html_class_prefix = $args['html_class_prefix'];
3228 $html_name_prefix = $args['html_name_prefix'];
3229 $settings = $args['settings'];
3230 $legend_positions = $settings['legend_positions'];
3231 $legend_position = $settings['legend_position'];
3232 $legend_alignments = $settings['legend_alignments'];
3233 $legend_alignment = $settings['legend_alignment'];
3234 $legend_color = $settings['legend_color'];
3235 $legend_font_size = $settings['legend_font_size'];
3236 $legend_bold = $settings['legend_bold'];
3237 $legend_italic = $settings['legend_italic'];
3238
3239 ob_start();
3240 ?>
3241 <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">
3242 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3243 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3244 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3245 <label for="ays-chart-option-legend-position">
3246 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3247 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") ); ?>">
3248 <i class="ays_fa ays_fa_info_circle"></i>
3249 </a>
3250 </label>
3251 </div>
3252 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3253 <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]">
3254 <?php
3255 foreach ( $legend_positions as $option_slug => $option ):
3256 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3257
3258 $type_class = '';
3259 if ($option_slug == 'left') {
3260 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3261 } else if ($option_slug == 'in') {
3262 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3263 } else if ($option_slug == 'labeled') {
3264 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3265 }
3266
3267 ?>
3268
3269 <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>
3270 <?php
3271 endforeach;
3272 ?>
3273 </select>
3274 </div>
3275 </div> <!-- Legend position -->
3276 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3277 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3278 <label for="ays-chart-option-legend-alignment">
3279 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3280 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") ); ?>">
3281 <i class="ays_fa ays_fa_info_circle"></i>
3282 </a>
3283 </label>
3284 </div>
3285 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3286 <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]">
3287 <?php
3288 foreach ( $legend_alignments as $option_slug => $option ):
3289 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3290 ?>
3291 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3292 <?php
3293 endforeach;
3294 ?>
3295 </select>
3296 </div>
3297 </div> <!-- Legend alignment -->
3298 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3299 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3300 <label for="ays-chart-option-legend-font-color">
3301 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3302 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") ); ?>">
3303 <i class="ays_fa ays_fa_info_circle"></i>
3304 </a>
3305 </label>
3306 </div>
3307 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3308 <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) ?>">
3309 </div>
3310 </div> <!-- Legend font color -->
3311 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3312 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3313 <label for="ays-chart-option-legend-font-size" class="form-label">
3314 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3315 <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") ); ?>">
3316 <i class="ays_fa ays_fa_info_circle"></i>
3317 </a>
3318 </label>
3319 </div>
3320 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3321 <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) ?>">
3322 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3323 </div>
3324 </div> <!-- Font size -->
3325 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3326 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3327 <label for="ays-chart-option-legend-italic">
3328 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3329 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3330 <i class="ays_fa ays_fa_info_circle"></i>
3331 </a>
3332 </label>
3333 </div>
3334 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3335 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3336 <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); ?> >
3337 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3338 </label>
3339 </div>
3340 </div> <!-- Italic text -->
3341 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3342 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3343 <label for="ays-chart-option-legend-bold">
3344 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3345 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3346 <i class="ays_fa ays_fa_info_circle"></i>
3347 </a>
3348 </label>
3349 </div>
3350 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3351 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3352 <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); ?> >
3353 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3354 </label>
3355 </div>
3356 </div> <!-- Bold text -->
3357 </div>
3358 </div>
3359 <?php
3360 $content = ob_get_clean();
3361
3362 $title = __( 'Legend', "chart-builder" );
3363
3364 $sources['legend'] = array(
3365 'content' => $content,
3366 'title' => $title
3367 );
3368
3369 return $sources;
3370 }
3371
3372 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3373 $html_class_prefix = $args['html_class_prefix'];
3374 $html_name_prefix = $args['html_name_prefix'];
3375 $settings = $args['settings'];
3376
3377 $haxis_title = $settings['haxis_title'];
3378 $axes_text_positions = $settings['axes_text_positions'];
3379 $haxis_text_position = $settings['haxis_text_position'];
3380 $haxis_direction = $settings['haxis_direction'];
3381 $haxis_text_color = $settings['haxis_text_color'];
3382 $haxis_baseline_color = $settings['haxis_baseline_color'];
3383 $haxis_slanted_options = $settings['haxis_slanted_options'];
3384 $haxis_slanted = $settings['haxis_slanted'];
3385 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3386 $haxis_show_text_every = $settings['haxis_show_text_every'];
3387 $haxis_format_options = $settings['axes_format_options'];
3388 $haxis_format = $settings['haxis_format'];
3389 $haxis_label_font_size = $settings['haxis_label_font_size'];
3390 $haxis_max_value = $settings['haxis_max_value'];
3391 $haxis_min_value = $settings['haxis_min_value'];
3392 $haxis_text_font_size = $settings['haxis_text_font_size'];
3393 $haxis_label_color = $settings['haxis_label_color'];
3394 $haxis_bold = $settings['haxis_bold'];
3395 $haxis_italic = $settings['haxis_italic'];
3396 $haxis_title_bold = $settings['haxis_title_bold'];
3397 $haxis_title_italic = $settings['haxis_title_italic'];
3398 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3399 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3400 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3401
3402 ob_start();
3403 ?>
3404 <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">
3405 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3406 <h6>Label</h6>
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-haxis-title" class="form-label">
3410 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3411 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the horizontal axis","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-haxis-title" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title]" value="<?php echo esc_attr($haxis_title) ?>">
3418 </div>
3419 </div> <!-- Horizontal axis label -->
3420 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3421 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3422 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3423 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3424 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3425 <i class="ays_fa ays_fa_info_circle"></i>
3426 </a>
3427 </label>
3428 </div>
3429 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3430 <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) ?>">
3431 </div>
3432 </div> <!-- Horizontal axis label font size -->
3433 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3434 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3435 <label for="ays-chart-option-haxis-label-color">
3436 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3437 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3438 <i class="ays_fa ays_fa_info_circle"></i>
3439 </a>
3440 </label>
3441 </div>
3442 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3443 <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) ?>">
3444 </div>
3445 </div> <!-- Horizontal axis label color -->
3446 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3447 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3448 <label for="ays-chart-option-haxis-title-italic">
3449 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3450 <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") ); ?>">
3451 <i class="ays_fa ays_fa_info_circle"></i>
3452 </a>
3453 </label>
3454 </div>
3455 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3456 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3457 <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); ?> >
3458 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3459 </label>
3460 </div>
3461 </div> <!-- Italic label -->
3462 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3463 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3464 <label for="ays-chart-option-haxis-title-bold">
3465 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3466 <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") ); ?>">
3467 <i class="ays_fa ays_fa_info_circle"></i>
3468 </a>
3469 </label>
3470 </div>
3471 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3472 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3473 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-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); ?> >
3474 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3475 </label>
3476 </div>
3477 </div> <!-- Bold label -->
3478 <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">
3479 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3480 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3481 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3482 <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") ); ?>">
3483 <i class="ays_fa ays_fa_info_circle"></i>
3484 </a>
3485 </label>
3486 </div>
3487 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3488 <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">
3489 </div>
3490 </div> <!-- Label interval -->
3491
3492 <br>
3493 <h6>Text</h6>
3494 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3495 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3496 <label for="ays-chart-option-haxis-text-position" class="form-label">
3497 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3498 <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") ); ?>">
3499 <i class="ays_fa ays_fa_info_circle"></i>
3500 </a>
3501 </label>
3502 </div>
3503 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3504 <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]">
3505 <?php
3506 foreach ( $axes_text_positions as $option_slug => $option ):
3507 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3508 ?>
3509 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3510 <?php
3511 endforeach;
3512 ?>
3513 </select>
3514 </div>
3515 </div> <!-- Horizontal axis text position -->
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-text-color">
3519 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3520 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","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) ?>input-align-right">
3526 <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) ?>">
3527 </div>
3528 </div> <!-- Horizontal axis text color -->
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-text-font-size" class="form-label">
3532 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3533 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","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) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3539 <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) ?>">
3540 </div>
3541 </div> <!-- Horizontal axis text font size -->
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-text-direction">
3545 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3546 <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") ); ?>">
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-text-direction" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_direction]" value="-1" <?php echo esc_attr($haxis_direction); ?> >
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> <!-- Horizontal axis text direction -->
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-italic">
3561 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3562 <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") ); ?>">
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-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_italic]" value="on" <?php echo esc_attr($haxis_italic); ?> >
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> <!-- Italic text -->
3574 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-bold">
3577 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3578 <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") ); ?>">
3579 <i class="ays_fa ays_fa_info_circle"></i>
3580 </a>
3581 </label>
3582 </div>
3583 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3584 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3585 <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); ?> >
3586 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3587 </label>
3588 </div>
3589 </div> <!-- Bold text -->
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-slanted-text" class="form-label">
3593 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
3594 <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") ); ?>">
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-slanted-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_slanted]">
3601 <?php
3602 foreach ( $haxis_slanted_options as $option_slug => $option ):
3603 $selected = ( $haxis_slanted == $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 slanted text -->
3612 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
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-slanted-text-angle" class="form-label">
3615 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
3616 <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") ); ?>">
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) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3622 <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">
3623 </div>
3624 </div> <!-- Horizontal axis slanted text angle -->
3625
3626 <br>
3627 <h6>Gridlines</h6>
3628 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3629 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3630 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
3631 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
3632 <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") ); ?>">
3633 <i class="ays_fa ays_fa_info_circle"></i>
3634 </a>
3635 </label>
3636 </div>
3637 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3638 <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) ?>">
3639 </div>
3640 </div> <!-- Horizontal axis gridlines count -->
3641 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3642 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3643 <label for="ays-chart-option-haxis-gridlines-color">
3644 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3645 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
3646 <i class="ays_fa ays_fa_info_circle"></i>
3647 </a>
3648 </label>
3649 </div>
3650 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3651 <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) ?>">
3652 </div>
3653 </div> <!-- Horizontal axis gridlines color -->
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-minor-gridlines-color">
3657 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
3658 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
3659 <i class="ays_fa ays_fa_info_circle"></i>
3660 </a>
3661 </label>
3662 </div>
3663 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3664 <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) ?>">
3665 </div>
3666 </div> <!-- Horizontal axis minor gridlines color -->
3667 <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">
3668 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3669 <label for="ays-chart-option-haxis-baseline-color">
3670 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
3671 <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") ); ?>">
3672 <i class="ays_fa ays_fa_info_circle"></i>
3673 </a>
3674 </label>
3675 </div>
3676 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3677 <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) ?>">
3678 </div>
3679 </div> <!-- Horizontal axis baseline color -->
3680
3681 <br>
3682 <h6>Format</h6>
3683 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3684 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3685 <label for="ays-chart-option-haxis-format" class="form-label">
3686 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
3687 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
3688 echo htmlspecialchars( sprintf (
3689 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
3690 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
3691 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
3692 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
3693 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
3694 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
3695 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
3696 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
3697 '<em>', '</em>',
3698 '<em>', '</em>',
3699 '<em>', '</em>',
3700 '<em>', '</em>',
3701 '<em>', '</em>',
3702 '<em>', '</em>',
3703 '<em>', '</em>'
3704 ) );
3705 ?>">
3706 <i class="ays_fa ays_fa_info_circle"></i>
3707 </a>
3708 </label>
3709 </div>
3710 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3711 <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]">
3712 <?php
3713 foreach ( $haxis_format_options as $option_slug => $option ):
3714 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
3715 ?>
3716 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3717 <?php
3718 endforeach;
3719 ?>
3720 </select>
3721 </div>
3722 </div> <!-- Horizontal axis format -->
3723 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3724 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3725 <label for="ays-chart-option-haxis-max-value" class="form-label">
3726 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
3727 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
3728 <i class="ays_fa ays_fa_info_circle"></i>
3729 </a>
3730 </label>
3731 </div>
3732 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3733 <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) ?>">
3734 </div>
3735 </div> <!-- Horizontal axis max value -->
3736 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3737 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3738 <label for="ays-chart-option-haxis-min-value" class="form-label">
3739 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
3740 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
3741 <i class="ays_fa ays_fa_info_circle"></i>
3742 </a>
3743 </label>
3744 </div>
3745 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3746 <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) ?>">
3747 </div>
3748 </div> <!-- Horizontal axis min value -->
3749 </div>
3750 </div>
3751 <?php
3752 $content = ob_get_clean();
3753
3754 $title = __( 'Horizontal Axis Settings', "chart-builder" );
3755
3756 $sources['horizontal_axis'] = array(
3757 'content' => $content,
3758 'title' => $title
3759 );
3760
3761 return $sources;
3762 }
3763
3764 public function settings_contents_vertical_axis_settings( $sources, $args ){
3765 $html_class_prefix = $args['html_class_prefix'];
3766 $html_name_prefix = $args['html_name_prefix'];
3767 $settings = $args['settings'];
3768
3769 $vaxis_title = $settings['vaxis_title'];
3770 $axes_text_positions = $settings['axes_text_positions'];
3771 $vaxis_text_position = $settings['vaxis_text_position'];
3772 $vaxis_direction = $settings['vaxis_direction'];
3773 $vaxis_text_color = $settings['vaxis_text_color'];
3774 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
3775 $vaxis_format_options = $settings['axes_format_options'];
3776 $vaxis_format = $settings['vaxis_format'];
3777 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
3778 $vaxis_max_value = $settings['vaxis_max_value'];
3779 $vaxis_min_value = $settings['vaxis_min_value'];
3780 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
3781 $vaxis_label_color = $settings['vaxis_label_color'];
3782 $vaxis_bold = $settings['vaxis_bold'];
3783 $vaxis_italic = $settings['vaxis_italic'];
3784 $vaxis_title_bold = $settings['vaxis_title_bold'];
3785 $vaxis_title_italic = $settings['vaxis_title_italic'];
3786 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
3787 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
3788 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
3789
3790 ob_start();
3791 ?>
3792 <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">
3793 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3794 <h6>Label</h6>
3795 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3796 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3797 <label for="ays-chart-option-vaxis-title" class="form-label">
3798 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3799 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the vertical axis","chart-builder") ); ?>">
3800 <i class="ays_fa ays_fa_info_circle"></i>
3801 </a>
3802 </label>
3803 </div>
3804 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3805 <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) ?>">
3806 </div>
3807 </div> <!-- Vertical axis label -->
3808 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3809 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3810 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
3811 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3812 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
3813 <i class="ays_fa ays_fa_info_circle"></i>
3814 </a>
3815 </label>
3816 </div>
3817 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3818 <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) ?>">
3819 </div>
3820 </div> <!-- Vertical axis label font size -->
3821 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3822 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3823 <label for="ays-chart-option-vaxis-label-color">
3824 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3825 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3826 <i class="ays_fa ays_fa_info_circle"></i>
3827 </a>
3828 </label>
3829 </div>
3830 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3831 <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) ?>">
3832 </div>
3833 </div> <!-- Vertical axis label color -->
3834 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3835 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3836 <label for="ays-chart-option-vaxis-title-italic">
3837 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3838 <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") ); ?>">
3839 <i class="ays_fa ays_fa_info_circle"></i>
3840 </a>
3841 </label>
3842 </div>
3843 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3844 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3845 <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); ?> >
3846 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3847 </label>
3848 </div>
3849 </div> <!-- Italic label -->
3850 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3851 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3852 <label for="ays-chart-option-vaxis-title-bold">
3853 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3854 <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") ); ?>">
3855 <i class="ays_fa ays_fa_info_circle"></i>
3856 </a>
3857 </label>
3858 </div>
3859 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3860 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3861 <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); ?> >
3862 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3863 </label>
3864 </div>
3865 </div> <!-- Bold label -->
3866
3867 <br>
3868 <h6>Text</h6>
3869 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3870 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3871 <label for="ays-chart-option-vaxis-text-position" class="form-label">
3872 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3873 <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") ); ?>">
3874 <i class="ays_fa ays_fa_info_circle"></i>
3875 </a>
3876 </label>
3877 </div>
3878 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3879 <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]">
3880 <?php
3881 foreach ( $axes_text_positions as $option_slug => $option ):
3882 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
3883 ?>
3884 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3885 <?php
3886 endforeach;
3887 ?>
3888 </select>
3889 </div>
3890 </div> <!-- Vertical axis text position -->
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-text-color">
3894 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3895 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","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) ?>input-align-right">
3901 <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) ?>">
3902 </div>
3903 </div> <!-- Vertical axis text color -->
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-text-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 horizontal axis text.","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-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) ?>">
3915 </div>
3916 </div> <!-- Vertical axis text 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-text-direction">
3920 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3921 <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") ); ?>">
3922 <i class="ays_fa ays_fa_info_circle"></i>
3923 </a>
3924 </label>
3925 </div>
3926 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3927 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3928 <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); ?> >
3929 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3930 </label>
3931 </div>
3932 </div> <!-- Vertical axis text direction -->
3933 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3934 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3935 <label for="ays-chart-option-vaxis-italic">
3936 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3937 <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") ); ?>">
3938 <i class="ays_fa ays_fa_info_circle"></i>
3939 </a>
3940 </label>
3941 </div>
3942 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3943 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3944 <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); ?> >
3945 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3946 </label>
3947 </div>
3948 </div> <!-- Italic text -->
3949 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3950 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3951 <label for="ays-chart-option-vaxis-bold">
3952 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3953 <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") ); ?>">
3954 <i class="ays_fa ays_fa_info_circle"></i>
3955 </a>
3956 </label>
3957 </div>
3958 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3959 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3960 <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); ?> >
3961 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3962 </label>
3963 </div>
3964 </div> <!-- Bold text -->
3965
3966 <br>
3967 <h6>Gridlines</h6>
3968 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3969 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3970 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
3971 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
3972 <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") ); ?>">
3973 <i class="ays_fa ays_fa_info_circle"></i>
3974 </a>
3975 </label>
3976 </div>
3977 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3978 <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) ?>">
3979 </div>
3980 </div> <!-- Vertical axis gridlines count -->
3981 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3982 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3983 <label for="ays-chart-option-vaxis-gridlines-color">
3984 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3985 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
3986 <i class="ays_fa ays_fa_info_circle"></i>
3987 </a>
3988 </label>
3989 </div>
3990 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3991 <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) ?>">
3992 </div>
3993 </div> <!-- Vertical axis gridlines color -->
3994 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3995 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3996 <label for="ays-chart-option-vaxis-minor-gridlines-color">
3997 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
3998 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
3999 <i class="ays_fa ays_fa_info_circle"></i>
4000 </a>
4001 </label>
4002 </div>
4003 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4004 <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) ?>">
4005 </div>
4006 </div> <!-- Vertical axis minor gridlines color -->
4007 <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">
4008 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4009 <label for="ays-chart-option-vaxis-baseline-color">
4010 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4011 <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") ); ?>">
4012 <i class="ays_fa ays_fa_info_circle"></i>
4013 </a>
4014 </label>
4015 </div>
4016 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4017 <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) ?>">
4018 </div>
4019 </div> <!-- Vertical axis baseline color -->
4020
4021 <br>
4022 <h6>Format</h6>
4023 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4024 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4025 <label for="ays-chart-option-vaxis-format" class="form-label">
4026 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4027 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4028 echo htmlspecialchars( sprintf (
4029 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4030 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4031 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4032 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4033 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4034 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4035 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4036 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4037 '<em>', '</em>',
4038 '<em>', '</em>',
4039 '<em>', '</em>',
4040 '<em>', '</em>',
4041 '<em>', '</em>',
4042 '<em>', '</em>',
4043 '<em>', '</em>'
4044 ) );
4045 ?>">
4046 <i class="ays_fa ays_fa_info_circle"></i>
4047 </a>
4048 </label>
4049 </div>
4050 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4051 <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]">
4052 <?php
4053 foreach ( $vaxis_format_options as $option_slug => $option ):
4054 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4055 ?>
4056 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4057 <?php
4058 endforeach;
4059 ?>
4060 </select>
4061 </div>
4062 </div> <!-- Vertical axis format -->
4063 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4064 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4065 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4066 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4067 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4068 <i class="ays_fa ays_fa_info_circle"></i>
4069 </a>
4070 </label>
4071 </div>
4072 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4073 <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) ?>">
4074 </div>
4075 </div> <!-- Vertical axis max value -->
4076 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4077 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4078 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4079 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4080 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4081 <i class="ays_fa ays_fa_info_circle"></i>
4082 </a>
4083 </label>
4084 </div>
4085 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4086 <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) ?>">
4087 </div>
4088 </div> <!-- Vertical axis min value -->
4089 </div>
4090 </div>
4091 <?php
4092 $content = ob_get_clean();
4093
4094 $title = __( 'Vertical Axis Settings', "chart-builder" );
4095
4096 $sources['vertical_axis'] = array(
4097 'content' => $content,
4098 'title' => $title
4099 );
4100
4101 return $sources;
4102 }
4103
4104 public function settings_contents_animation_settings( $sources, $args ) {
4105 $html_class_prefix = $args['html_class_prefix'];
4106 $html_name_prefix = $args['html_name_prefix'];
4107 $settings = $args['settings'];
4108
4109 $enable_animation = $settings['enable_animation'];
4110 $animation_duration = $settings['animation_duration'];
4111 $animation_startup = $settings['animation_startup'];
4112 $animation_easing_options = $settings['animation_easing_options'];
4113 $animation_easing = $settings['animation_easing'];
4114
4115 ob_start();
4116 ?>
4117 <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">
4118 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
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-enable-animation">
4122 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4123 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4124 <i class="ays_fa ays_fa_info_circle"></i>
4125 </a>
4126 </label>
4127 </div>
4128 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4129 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4130 <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); ?> >
4131 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4132 </label>
4133 </div>
4134 </div> <!-- Enable animation -->
4135 <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'; ?>">
4136 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4137 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4138 <label for="ays-chart-option-animation-duration" class="form-label">
4139 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4140 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4141 <i class="ays_fa ays_fa_info_circle"></i>
4142 </a>
4143 </label>
4144 </div>
4145 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4146 <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) ?>">
4147 </div>
4148 </div> <!-- Animation duration -->
4149 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4150 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4151 <label for="ays-chart-option-animation-startup">
4152 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4153 <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") ); ?>">
4154 <i class="ays_fa ays_fa_info_circle"></i>
4155 </a>
4156 </label>
4157 </div>
4158 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4159 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4160 <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); ?> >
4161 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4162 </label>
4163 </div>
4164 </div> <!-- Animation startup -->
4165 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4166 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4167 <label for="ays-chart-option-animation-easing" class="form-label">
4168 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4169 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4170 echo htmlspecialchars( sprintf(
4171 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4172 __('%sLinear:%s Constant speed.', "chart-builder") . "</li><li>" .
4173 __('%sEase in:%s Start slow and speed up.', "chart-builder") . "</li><li>" .
4174 __('%sEase out:%s Start fast and slow down.', "chart-builder") . "</li><li>" .
4175 __('%sEase in and out:%s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4176 '<em>',
4177 '</em>',
4178 '<em>',
4179 '</em>',
4180 '<em>',
4181 '</em>',
4182 '<em>',
4183 '</em>'
4184 ) );
4185 ?>">
4186 <i class="ays_fa ays_fa_info_circle"></i>
4187 </a>
4188 </label>
4189 </div>
4190 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4191 <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]">
4192 <?php
4193 foreach ( $animation_easing_options as $option_slug => $option ):
4194 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4195 ?>
4196 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4197 <?php
4198 endforeach;
4199 ?>
4200 </select>
4201 </div>
4202 </div> <!-- Animation easing -->
4203 <div>
4204 </div>
4205 </div>
4206 <?php
4207 $content = ob_get_clean();
4208
4209 $title = __( 'Chart animation', "chart-builder" );
4210
4211 $sources['animation'] = array(
4212 'content' => $content,
4213 'title' => $title
4214 );
4215
4216 return $sources;
4217 }
4218
4219 public function settings_contents_live_chart_settings( $sources, $args ) {
4220 $html_class_prefix = $args['html_class_prefix'];
4221 $html_name_prefix = $args['html_name_prefix'];
4222
4223 ob_start();
4224 ?>
4225 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-live-chart-settings-tab">
4226 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4227 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4228 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4229 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4230 <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>
4231 <div class="ays-pro-features-v2-video-text">
4232 <?php echo __("Watch Video" , "chart-builder"); ?>
4233 </div>
4234 </a>
4235 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4236 <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>
4237 <div class="ays-pro-features-v2-upgrade-text">
4238 <?php echo __("Upgrade" , "chart-builder"); ?>
4239 </div>
4240 </a>
4241 </div>
4242 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4243 <label for="ays-chart-option-enable-live-chart">
4244 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4245 <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") ); ?>">
4246 <i class="ays_fa ays_fa_info_circle"></i>
4247 </a>
4248 </label>
4249 </div>
4250 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4251 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4252 <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">
4253 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4254 </label>
4255 </div>
4256 </div> <!-- Enable live chart -->
4257 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4258 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4259 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4260 <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>
4261 <div class="ays-pro-features-v2-video-text">
4262 <?php echo __("Watch Video" , "chart-builder"); ?>
4263 </div>
4264 </a>
4265 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4266 <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>
4267 <div class="ays-pro-features-v2-upgrade-text">
4268 <?php echo __("Upgrade" , "chart-builder"); ?>
4269 </div>
4270 </a>
4271 </div>
4272 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4273 <label for="ays-chart-option-live-chart-interval" class="form-label">
4274 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4275 <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") ); ?>">
4276 <i class="ays_fa ays_fa_info_circle"></i>
4277 </a>
4278 </label>
4279 </div>
4280 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4281 <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">
4282 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4283 </div>
4284 </div> <!-- Live chart interval -->
4285 </div>
4286 </div>
4287 <?php
4288 $content = ob_get_clean();
4289
4290 $title = __( 'Live Chart', "chart-builder" );
4291
4292 $sources['live_chart'] = array(
4293 'content' => $content,
4294 'title' => $title
4295 );
4296
4297 return $sources;
4298
4299 }
4300
4301 public function settings_contents_export_options( $sources, $args ){
4302 $html_class_prefix = $args['html_class_prefix'];
4303 $html_name_prefix = $args['html_name_prefix'];
4304 $settings = $args['settings'];
4305
4306 $enable_img = $settings['enable_img'];
4307
4308 ob_start();
4309 ?>
4310 <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">
4311 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4312 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4313 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4314 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4315 <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>
4316 <div class="ays-pro-features-v2-video-text">
4317 <?php echo __("Watch Video" , "chart-builder"); ?>
4318 </div>
4319 </a>
4320 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4321 <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>
4322 <div class="ays-pro-features-v2-upgrade-text">
4323 <?php echo __("Upgrade" , "chart-builder"); ?>
4324 </div>
4325 </a>
4326 </div>
4327 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4328 <label for="ays-chart-option-export-print">
4329 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4330 <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") ); ?>">
4331 <i class="ays_fa ays_fa_info_circle"></i>
4332 </a>
4333 </label>
4334 </div>
4335 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4336 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4337 <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">
4338 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4339 </label>
4340 </div>
4341 </div> <!-- Print option end -->
4342 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4343 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4344 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4345 <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>
4346 <div class="ays-pro-features-v2-video-text">
4347 <?php echo __("Watch Video" , "chart-builder"); ?>
4348 </div>
4349 </a>
4350 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4351 <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>
4352 <div class="ays-pro-features-v2-upgrade-text">
4353 <?php echo __("Upgrade" , "chart-builder"); ?>
4354 </div>
4355 </a>
4356 </div>
4357 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4358 <label for="ays-chart-option-export-Excel">
4359 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4360 <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") ); ?>">
4361 <i class="ays_fa ays_fa_info_circle"></i>
4362 </a>
4363 </label>
4364 </div>
4365 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4366 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4367 <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">
4368 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4369 </label>
4370 </div>
4371 </div> <!-- Excel option end -->
4372 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4373 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4374 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4375 <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>
4376 <div class="ays-pro-features-v2-video-text">
4377 <?php echo __("Watch Video" , "chart-builder"); ?>
4378 </div>
4379 </a>
4380 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4381 <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>
4382 <div class="ays-pro-features-v2-upgrade-text">
4383 <?php echo __("Upgrade" , "chart-builder"); ?>
4384 </div>
4385 </a>
4386 </div>
4387 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4388 <label for="ays-chart-option-export-CSV">
4389 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4390 <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") ); ?>">
4391 <i class="ays_fa ays_fa_info_circle"></i>
4392 </a>
4393 </label>
4394 </div>
4395 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4396 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4397 <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">
4398 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4399 </label>
4400 </div>
4401 </div> <!-- CSV option end -->
4402 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4403 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4404 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4405 <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>
4406 <div class="ays-pro-features-v2-video-text">
4407 <?php echo __("Watch Video" , "chart-builder"); ?>
4408 </div>
4409 </a>
4410 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4411 <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>
4412 <div class="ays-pro-features-v2-upgrade-text">
4413 <?php echo __("Upgrade" , "chart-builder"); ?>
4414 </div>
4415 </a>
4416 </div>
4417 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4418 <label for="ays-chart-option-export-Copy">
4419 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4420 <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") ); ?>">
4421 <i class="ays_fa ays_fa_info_circle"></i>
4422 </a>
4423 </label>
4424 </div>
4425 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4426 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4427 <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">
4428 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4429 </label>
4430 </div>
4431 </div> <!-- Copy option end -->
4432 <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">
4433 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4434 <label for="ays-chart-option-export-img">
4435 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4436 <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") ); ?>">
4437 <i class="ays_fa ays_fa_info_circle"></i>
4438 </a>
4439 </label>
4440 </div>
4441 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4442 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4443 <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?> >
4444 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4445 </label>
4446 </div>
4447 </div> <!-- IMG option end -->
4448 </div>
4449 </div>
4450 <?php
4451
4452 $content = ob_get_clean();
4453
4454 $title = __( 'Frontend Actions', "chart-builder" );
4455
4456 $sources['export_options'] = array(
4457 'content' => $content,
4458 'title' => $title
4459 );
4460
4461 return $sources;
4462 }
4463
4464 /**
4465 * Chart page styles contents
4466 * @param $args
4467 */
4468 public function ays_chart_page_styles_contents( $args ){
4469 $chart_source_type = $args['chart_source_type'];
4470
4471 if ($chart_source_type === 'chart-js') {
4472 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4473 } else {
4474 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4475 }
4476
4477 $sources = array();
4478 foreach ( $sources_contents as $key => $sources_content ) {
4479 $collapsed = $key == 'chart' ? 'false' : 'true';
4480
4481 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4482 if(isset($sources_content['title'])){
4483 $content .= '<legend class="ays-accordion-options-header">';
4484 $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">
4485 <g>
4486 <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" />
4487 </g>
4488 </svg>';
4489
4490 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4491 }
4492
4493 $content .= '<div class="ays-accordion-options-content">';
4494 $content .= $sources_content['content'];
4495 $content .= '</div>';
4496
4497 $content .= '</fieldset>';
4498
4499 $sources[] = $content;
4500 }
4501 $content_for_escape = implode('' , $sources );
4502 echo html_entity_decode(esc_html( $content_for_escape ));
4503 }
4504
4505 public function settings_contents_chart_styles_settings( $sources, $args ){
4506 $html_class_prefix = $args['html_class_prefix'];
4507 $html_name_prefix = $args['html_name_prefix'];
4508 $settings = $args['settings'];
4509
4510 $width = $settings['width'];
4511 $width_format = $settings['width_format'];
4512 $title_positions = $settings['title_positions'];
4513 $position = $settings['position'];
4514 $width_format_options = $settings['width_format_options'];
4515 $responsive_width = $settings['responsive_width'];
4516 $height = $settings['height'];
4517 $height_format = $settings['height_format'];
4518 $font_size = $settings['font_size'];
4519 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4520 $org_chart_font_size = $settings['org_chart_font_size'];
4521 $background_color = $settings['background_color'];
4522 $transparent_background = $settings['transparent_background'];
4523 $border_width = $settings['border_width'];
4524 $border_radius = $settings['border_radius'];
4525 $border_color = $settings['border_color'];
4526 $box_shadow = $settings['box_shadow'];
4527 $box_shadow_color = $settings['box_shadow_color'];
4528 ob_start();
4529 ?>
4530 <div class="ays-accordion-data-main-wrap">
4531 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4532 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4533 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4534 <label for="ays-chart-option-width" class="form-label">
4535 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
4536 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container, in percents.","chart-builder") ); ?>">
4537 <i class="ays_fa ays_fa_info_circle"></i>
4538 </a>
4539 </label>
4540 </div>
4541 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4542 <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) ?>">
4543 <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]">
4544 <?php
4545 foreach ( $width_format_options as $option_slug => $option ):
4546 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
4547 ?>
4548 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4549 <?php
4550 endforeach;
4551 ?>
4552 </select>
4553 </div>
4554 </div> <!-- Width -->
4555 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4556 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4557 <label for="ays-chart-option-responsive-width" class="form-label">
4558 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
4559 <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") ); ?>">
4560 <i class="ays_fa ays_fa_info_circle"></i>
4561 </a>
4562 </label>
4563 </div>
4564 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4565 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4566 <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); ?> >
4567 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4568 </label>
4569 </div>
4570 </div> <!-- Responsive Width -->
4571 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4572 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4573 <label for="ays-chart-option-position">
4574 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4575 <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") ); ?>">
4576 <i class="ays_fa ays_fa_info_circle"></i>
4577 </a>
4578 </label>
4579 </div>
4580 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4581 <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]">
4582 <?php
4583 foreach ( $title_positions as $option_slug => $option ):
4584 $selected = ( $position == $option_slug ) ? 'selected' : '';
4585 ?>
4586 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4587 <?php
4588 endforeach;
4589 ?>
4590 </select>
4591 </div>
4592 </div> <!-- Title position -->
4593 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4594 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4595 <label for="ays-chart-option-height" class="form-label">
4596 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
4597 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
4598 <i class="ays_fa ays_fa_info_circle"></i>
4599 </a>
4600 </label>
4601 </div>
4602 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4603 <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) ?>">
4604 <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]">
4605 <?php
4606 foreach ( $width_format_options as $option_slug => $option ):
4607 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
4608 ?>
4609 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4610 <?php
4611 endforeach;
4612 ?>
4613 </select>
4614 </div>
4615 </div> <!-- Height -->
4616 <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">
4617 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4618 <label for="ays-chart-option-font-size" class="form-label">
4619 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4620 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart text.","chart-builder") ); ?>">
4621 <i class="ays_fa ays_fa_info_circle"></i>
4622 </a>
4623 </label>
4624 </div>
4625 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4626 <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) ?>">
4627 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
4628 </div>
4629 </div> <!-- Font size -->
4630 <div class="form-group row mb-2 <?= $html_class_prefix ?>options-section cb-changable-opt cb-org_chart-opt display_none">
4631 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
4632 <label for="ays-chart-option-org-chart-font-size" class="form-label">
4633 <?php echo __( "Element size", $this->plugin_name ); ?>
4634 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The size of the chart element.","chart-builder") ); ?>">
4635 <i class="ays_fa ays_fa_info_circle"></i>
4636 </a>
4637 </label>
4638 </div>
4639 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4640 <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]">
4641 <?php
4642 foreach ( $org_chart_font_size_options as $option_slug => $option ):
4643 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
4644 ?>
4645 <option value="<?php echo $option_slug; ?>" <?php echo $selected; ?>><?php echo $option; ?></option>
4646 <?php
4647 endforeach;
4648 ?>
4649 </select>
4650 </div>
4651 </div> <!-- Font size for org type -->
4652 <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">
4653 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4654 <label for="ays-chart-option-background-color">
4655 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4656 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart container.","chart-builder") ); ?>">
4657 <i class="ays_fa ays_fa_info_circle"></i>
4658 </a>
4659 </label>
4660 </div>
4661 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4662 <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) ?>">
4663 </div>
4664 </div> <!-- Background color -->
4665 <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">
4666 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4667 <label for="ays-chart-option-transparent-background" class="form-label">
4668 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
4669 <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") ); ?>">
4670 <i class="ays_fa ays_fa_info_circle"></i>
4671 </a>
4672 </label>
4673 </div>
4674 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4675 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4676 <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); ?> >
4677 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4678 </label>
4679 </div>
4680 </div> <!-- Transparent background -->
4681 <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">
4682 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4683 <label for="ays-chart-option-border-width">
4684 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4685 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container border.","chart-builder") ); ?>">
4686 <i class="ays_fa ays_fa_info_circle"></i>
4687 </a>
4688 </label>
4689 </div>
4690 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4691 <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) ?>">
4692 </div>
4693 </div> <!-- Border Width -->
4694 <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">
4695 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4696 <label for="ays-chart-option-border-color">
4697 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4698 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart container.","chart-builder") ); ?>">
4699 <i class="ays_fa ays_fa_info_circle"></i>
4700 </a>
4701 </label>
4702 </div>
4703 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4704 <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) ?>">
4705 </div>
4706 </div> <!-- Border color -->
4707 <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">
4708 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4709 <label for="ays-chart-option-border-radius">
4710 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
4711 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border radius of the chart container.","chart-builder") ); ?>">
4712 <i class="ays_fa ays_fa_info_circle"></i>
4713 </a>
4714 </label>
4715 </div>
4716 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4717 <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) ?>">
4718 </div>
4719 </div> <!-- Border radius -->
4720 <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">
4721 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4722 <label for="ays-chart-option-box-shadow" class="form-label">
4723 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
4724 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
4725 <i class="ays_fa ays_fa_info_circle"></i>
4726 </a>
4727 </label>
4728 </div>
4729 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4730 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4731 <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); ?> >
4732 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4733 </label>
4734 </div>
4735 </div> <!-- box shadow -->
4736 <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">
4737 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4738 <label for="ays-chart-option-box-shadow-color" class="form-label">
4739 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
4740 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
4741 <i class="ays_fa ays_fa_info_circle"></i>
4742 </a>
4743 </label>
4744 </div>
4745 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4746 <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) ?>">
4747 </div>
4748 </div> <!-- box shadow color -->
4749 </div>
4750 </div>
4751 <?php
4752 $content = ob_get_clean();
4753
4754 $title = __( 'Chart', "chart-builder" );
4755
4756 $sources['chart'] = array(
4757 'content' => $content,
4758 'title' => $title
4759 );
4760
4761 return $sources;
4762 }
4763
4764 public function settings_contents_chart_area_styles_settings( $sources, $args ){
4765 $html_class_prefix = $args['html_class_prefix'];
4766 $html_name_prefix = $args['html_name_prefix'];
4767 $settings = $args['settings'];
4768
4769 $chart_background_color = $settings['chart_background_color'];
4770 $chart_border_color = $settings['chart_border_color'];
4771 $chart_left_margin = $settings['chart_left_margin'];
4772 $chart_right_margin = $settings['chart_right_margin'];
4773 $chart_top_margin = $settings['chart_top_margin'];
4774 $chart_bottom_margin = $settings['chart_bottom_margin'];
4775 $chart_border_width = $settings['chart_border_width'];
4776 ob_start();
4777 ?>
4778 <div class="ays-accordion-data-main-wrap">
4779 <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">
4780 <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">
4781 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4782 <label for="ays-chart-option-chart-background-color">
4783 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4784 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart area.","chart-builder") ); ?>">
4785 <i class="ays_fa ays_fa_info_circle"></i>
4786 </a>
4787 </label>
4788 </div>
4789 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4790 <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) ?>">
4791 </div>
4792 </div> <!-- Chart Area background color -->
4793 <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">
4794 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4795 <label for="ays-chart-option-chart-border-width">
4796 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4797 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border width of the chart area.","chart-builder") ); ?>">
4798 <i class="ays_fa ays_fa_info_circle"></i>
4799 </a>
4800 </label>
4801 </div>
4802 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4803 <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) ?>">
4804 </div>
4805 </div> <!-- Chart Area Border Width -->
4806 <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">
4807 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4808 <label for="ays-chart-option-chart-border-color">
4809 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4810 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart area.","chart-builder") ); ?>">
4811 <i class="ays_fa ays_fa_info_circle"></i>
4812 </a>
4813 </label>
4814 </div>
4815 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4816 <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) ?>">
4817 </div>
4818 </div> <!-- Chart Area border color -->
4819 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4820 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4821 <label for="ays-chart-option-chart-left-margin">
4822 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
4823 <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") ); ?>">
4824 <i class="ays_fa ays_fa_info_circle"></i>
4825 </a>
4826 </label>
4827 </div>
4828 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4829 <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) ?>">
4830 </div>
4831 </div> <!-- Chart Area Left Margin -->
4832 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-chart-right-margin">
4835 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
4836 <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") ); ?>">
4837 <i class="ays_fa ays_fa_info_circle"></i>
4838 </a>
4839 </label>
4840 </div>
4841 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4842 <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) ?>">
4843 </div>
4844 </div> <!-- Chart Area Right Margin -->
4845 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4846 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4847 <label for="ays-chart-option-chart-top-margin">
4848 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
4849 <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") ); ?>">
4850 <i class="ays_fa ays_fa_info_circle"></i>
4851 </a>
4852 </label>
4853 </div>
4854 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4855 <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) ?>">
4856 </div>
4857 </div> <!-- Chart Area Top Margin -->
4858 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4859 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4860 <label for="ays-chart-option-chart-bottom-margin">
4861 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
4862 <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") ); ?>">
4863 <i class="ays_fa ays_fa_info_circle"></i>
4864 </a>
4865 </label>
4866 </div>
4867 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4868 <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) ?>">
4869 </div>
4870 </div> <!-- Chart Area Bottom Margin -->
4871 </div>
4872 </div>
4873 <?php
4874 $content = ob_get_clean();
4875
4876 $title = __( 'Chart Area', "chart-builder" );
4877
4878 $sources['chart_area'] = array(
4879 'content' => $content,
4880 'title' => $title
4881 );
4882
4883 return $sources;
4884 }
4885
4886 public function settings_contents_title_styles_settings( $sources, $args ){
4887 $html_class_prefix = $args['html_class_prefix'];
4888 $html_name_prefix = $args['html_name_prefix'];
4889 $settings = $args['settings'];
4890
4891 $title_color = $settings['title_color'];
4892 $title_shadow_color = $settings['title_shadow_color'];
4893 $title_font_size = $settings['title_font_size'];
4894 $title_gap = $settings['title_gap'];
4895 $title_gap_description = $settings['title_gap_description'];
4896 $title_positions = $settings['title_positions'];
4897 $title_position = $settings['title_position'];
4898 $title_bold = $settings['title_bold'];
4899 $title_text_shadow = $settings['title_text_shadow'];
4900 $title_italic = $settings['title_italic'];
4901 $text_transforms = $settings['text_transforms'];
4902 $text_decorations = $settings['text_decorations'];
4903 $title_text_transform = $settings['title_text_transform'];
4904 $title_text_decoration = $settings['title_text_decoration'];
4905 $title_letter_spacing = $settings['title_letter_spacing'];
4906 ob_start();
4907 ?>
4908 <div class="ays-accordion-data-main-wrap">
4909 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4910 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4911 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4912 <label for="ays-chart-option-title-color">
4913 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4914 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
4915 <i class="ays_fa ays_fa_info_circle"></i>
4916 </a>
4917 </label>
4918 </div>
4919 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4920 <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) ?>">
4921 </div>
4922 </div> <!-- Chart title color -->
4923 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4924 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4925 <label for="ays-chart-option-title-font-size" class="form-label">
4926 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4927 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
4928 <i class="ays_fa ays_fa_info_circle"></i>
4929 </a>
4930 </label>
4931 </div>
4932 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4933 <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) ?>">
4934 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
4935 </div>
4936 </div> <!-- Chart title font size -->
4937 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4938 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4939 <label for="ays-chart-option-title-bold" class="form-label">
4940 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4941 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
4942 <i class="ays_fa ays_fa_info_circle"></i>
4943 </a>
4944 </label>
4945 </div>
4946 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4947 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4948 <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); ?> >
4949 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4950 </label>
4951 </div>
4952 </div> <!-- Title bold -->
4953 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4955 <label for="ays-chart-option-title-italic" class="form-label">
4956 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4957 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
4958 <i class="ays_fa ays_fa_info_circle"></i>
4959 </a>
4960 </label>
4961 </div>
4962 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4963 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4964 <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); ?> >
4965 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4966 </label>
4967 </div>
4968 </div> <!-- Title italic -->
4969 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4970 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4971 <label for="ays-chart-option-title-position">
4972 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4973 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
4974 <i class="ays_fa ays_fa_info_circle"></i>
4975 </a>
4976 </label>
4977 </div>
4978 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4979 <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]">
4980 <?php
4981 foreach ( $title_positions as $option_slug => $option ):
4982 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
4983 ?>
4984 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4985 <?php
4986 endforeach;
4987 ?>
4988 </select>
4989 </div>
4990 </div> <!-- Title position -->
4991 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4992 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4993 <label for="ays-chart-option-title-gap" class="form-label">
4994 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
4995 <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") ); ?>">
4996 <i class="ays_fa ays_fa_info_circle"></i>
4997 </a>
4998 </label>
4999 </div>
5000 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5001 <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) ?>">
5002 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5003 </div>
5004 </div> <!-- Chart title gap -->
5005 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5006 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5007 <label for="ays-chart-option-title-gap-description" class="form-label">
5008 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5009 <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") ); ?>">
5010 <i class="ays_fa ays_fa_info_circle"></i>
5011 </a>
5012 </label>
5013 </div>
5014 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5015 <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) ?>">
5016 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5017 </div>
5018 </div> <!-- Chart title gap -->
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-text-transform">
5022 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5023 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text 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 <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]">
5030 <?php
5031 foreach ( $text_transforms as $option_slug => $option ):
5032 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5033 ?>
5034 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5035 <?php
5036 endforeach;
5037 ?>
5038 </select>
5039 </div>
5040 </div> <!-- Title text transform -->
5041 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5042 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5043 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5044 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5045 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5046 <i class="ays_fa ays_fa_info_circle"></i>
5047 </a>
5048 </label>
5049 </div>
5050 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5051 <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) ?>">
5052 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5053 </div>
5054 </div> <!-- Chart title letter spacing -->
5055 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5056 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5057 <label for="ays-chart-option-title-text-decoration">
5058 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5059 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5060 <i class="ays_fa ays_fa_info_circle"></i>
5061 </a>
5062 </label>
5063 </div>
5064 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5065 <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]">
5066 <?php
5067 foreach ( $text_decorations as $option_slug => $option ):
5068 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5069 ?>
5070 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5071 <?php
5072 endforeach;
5073 ?>
5074 </select>
5075 </div>
5076 </div> <!-- Title text decoration -->
5077 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5078 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5079 <label for="ays-chart-option-title-text-shadow" class="form-label">
5080 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5081 <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") ); ?>">
5082 <i class="ays_fa ays_fa_info_circle"></i>
5083 </a>
5084 </label>
5085 </div>
5086 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5087 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5088 <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); ?> >
5089 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5090 </label>
5091 </div>
5092 </div> <!-- Title bold -->
5093 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5094 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5095 <label for="ays-chart-option-title-shadow-color">
5096 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5097 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5098 <i class="ays_fa ays_fa_info_circle"></i>
5099 </a>
5100 </label>
5101 </div>
5102 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5103 <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) ?>">
5104 </div>
5105 </div> <!-- Chart title color -->
5106 </div>
5107 </div>
5108 <?php
5109 $content = ob_get_clean();
5110
5111 $title = __( 'Title', "chart-builder" );
5112
5113 $sources['title'] = array(
5114 'content' => $content,
5115 'title' => $title
5116 );
5117
5118 return $sources;
5119 }
5120
5121 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5122 $html_class_prefix = $args['html_class_prefix'];
5123 $html_name_prefix = $args['html_name_prefix'];
5124 $settings = $args['settings'];
5125
5126 $title_color = $settings['title_color'];
5127 $title_shadow_color = $settings['title_shadow_color'];
5128 $title_font_size = $settings['title_font_size'];
5129 $title_gap = $settings['title_gap'];
5130 $title_gap_description = $settings['title_gap_description'];
5131 $title_positions = $settings['title_positions'];
5132 $title_position = $settings['title_position'];
5133 $title_bold = $settings['title_bold'];
5134 $title_text_shadow = $settings['title_text_shadow'];
5135 $title_italic = $settings['title_italic'];
5136 $text_transforms = $settings['text_transforms'];
5137 $text_decorations = $settings['text_decorations'];
5138 $title_text_transform = $settings['title_text_transform'];
5139 $title_text_decoration = $settings['title_text_decoration'];
5140 $title_letter_spacing = $settings['title_letter_spacing'];
5141 ob_start();
5142 ?>
5143 <div class="ays-accordion-data-main-wrap">
5144 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5145 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5146 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5147 <label for="ays-chart-option-title-color">
5148 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5149 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5150 <i class="ays_fa ays_fa_info_circle"></i>
5151 </a>
5152 </label>
5153 </div>
5154 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5155 <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) ?>">
5156 </div>
5157 </div> <!-- Chart title color -->
5158 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5159 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5160 <label for="ays-chart-option-title-font-size" class="form-label">
5161 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5162 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5163 <i class="ays_fa ays_fa_info_circle"></i>
5164 </a>
5165 </label>
5166 </div>
5167 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5168 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-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) ?>">
5169 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5170 </div>
5171 </div> <!-- Chart title font size -->
5172 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5173 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5174 <label for="ays-chart-option-title-bold" class="form-label">
5175 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5176 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5177 <i class="ays_fa ays_fa_info_circle"></i>
5178 </a>
5179 </label>
5180 </div>
5181 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5182 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5183 <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); ?> >
5184 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5185 </label>
5186 </div>
5187 </div> <!-- Title bold -->
5188 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5189 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5190 <label for="ays-chart-option-title-italic" class="form-label">
5191 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5192 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5193 <i class="ays_fa ays_fa_info_circle"></i>
5194 </a>
5195 </label>
5196 </div>
5197 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5198 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5199 <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); ?> >
5200 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5201 </label>
5202 </div>
5203 </div> <!-- Title italic -->
5204 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5205 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5206 <label for="ays-chart-option-title-position">
5207 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5208 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5209 <i class="ays_fa ays_fa_info_circle"></i>
5210 </a>
5211 </label>
5212 </div>
5213 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5214 <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]">
5215 <?php
5216 foreach ( $title_positions as $option_slug => $option ):
5217 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5218 ?>
5219 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5220 <?php
5221 endforeach;
5222 ?>
5223 </select>
5224 </div>
5225 </div> <!-- Title position -->
5226 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5227 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5228 <label for="ays-chart-option-title-gap" class="form-label">
5229 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5230 <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") ); ?>">
5231 <i class="ays_fa ays_fa_info_circle"></i>
5232 </a>
5233 </label>
5234 </div>
5235 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5236 <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) ?>">
5237 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5238 </div>
5239 </div> <!-- Chart title gap -->
5240 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5241 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5242 <label for="ays-chart-option-title-gap-description" class="form-label">
5243 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5244 <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") ); ?>">
5245 <i class="ays_fa ays_fa_info_circle"></i>
5246 </a>
5247 </label>
5248 </div>
5249 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5250 <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) ?>">
5251 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5252 </div>
5253 </div> <!-- Chart title gap -->
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-text-transform">
5257 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5258 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text 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 <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]">
5265 <?php
5266 foreach ( $text_transforms as $option_slug => $option ):
5267 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5268 ?>
5269 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5270 <?php
5271 endforeach;
5272 ?>
5273 </select>
5274 </div>
5275 </div> <!-- Title text transform -->
5276 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5277 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5278 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5279 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5280 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5281 <i class="ays_fa ays_fa_info_circle"></i>
5282 </a>
5283 </label>
5284 </div>
5285 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5286 <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) ?>">
5287 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5288 </div>
5289 </div> <!-- Chart title letter spacing -->
5290 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5291 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5292 <label for="ays-chart-option-title-text-decoration">
5293 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5294 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5295 <i class="ays_fa ays_fa_info_circle"></i>
5296 </a>
5297 </label>
5298 </div>
5299 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5300 <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]">
5301 <?php
5302 foreach ( $text_decorations as $option_slug => $option ):
5303 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5304 ?>
5305 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5306 <?php
5307 endforeach;
5308 ?>
5309 </select>
5310 </div>
5311 </div> <!-- Title text decoration -->
5312 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5313 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5314 <label for="ays-chart-option-title-text-shadow" class="form-label">
5315 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5316 <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") ); ?>">
5317 <i class="ays_fa ays_fa_info_circle"></i>
5318 </a>
5319 </label>
5320 </div>
5321 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5322 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5323 <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); ?> >
5324 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5325 </label>
5326 </div>
5327 </div> <!-- Title bold -->
5328 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5329 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5330 <label for="ays-chart-option-title-shadow-color">
5331 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5332 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5333 <i class="ays_fa ays_fa_info_circle"></i>
5334 </a>
5335 </label>
5336 </div>
5337 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5338 <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) ?>">
5339 </div>
5340 </div> <!-- Chart title color -->
5341 </div>
5342 </div>
5343 <?php
5344 $content = ob_get_clean();
5345
5346 $title = __( 'Title', "chart-builder" );
5347
5348 $sources['title'] = array(
5349 'content' => $content,
5350 'title' => $title
5351 );
5352
5353 return $sources;
5354 }
5355
5356 public function settings_contents_description_styles_settings( $sources, $args ){
5357 $html_class_prefix = $args['html_class_prefix'];
5358 $html_name_prefix = $args['html_name_prefix'];
5359 $settings = $args['settings'];
5360
5361 $description_color = $settings['description_color'];
5362 $description_font_size = $settings['description_font_size'];
5363 $title_positions = $settings['title_positions'];
5364 $description_position = $settings['description_position'];
5365 $description_bold = $settings['description_bold'];
5366 $description_text_shadow = $settings['description_text_shadow'];
5367 $description_shadow_color = $settings['description_shadow_color'];
5368 $description_italic = $settings['description_italic'];
5369 $text_transforms = $settings['text_transforms'];
5370 $text_decorations = $settings['text_decorations'];
5371 $description_text_transform = $settings['description_text_transform'];
5372 $description_text_decoration = $settings['description_text_decoration'];
5373 $description_letter_spacing = $settings['description_letter_spacing'];
5374
5375 ob_start();
5376 ?>
5377 <div class="ays-accordion-data-main-wrap">
5378 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5379 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5380 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5381 <label for="ays-chart-option-description-color">
5382 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5383 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5384 <i class="ays_fa ays_fa_info_circle"></i>
5385 </a>
5386 </label>
5387 </div>
5388 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5389 <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) ?>">
5390 </div>
5391 </div> <!-- Chart description color -->
5392 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5393 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5394 <label for="ays-chart-option-description-font-size" class="form-label">
5395 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5396 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5397 <i class="ays_fa ays_fa_info_circle"></i>
5398 </a>
5399 </label>
5400 </div>
5401 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5402 <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) ?>">
5403 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5404 </div>
5405 </div> <!-- Chart description font size -->
5406 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5407 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5408 <label for="ays-chart-option-description-bold" class="form-label">
5409 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5410 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5411 <i class="ays_fa ays_fa_info_circle"></i>
5412 </a>
5413 </label>
5414 </div>
5415 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5416 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5417 <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); ?> >
5418 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5419 </label>
5420 </div>
5421 </div> <!-- Description bold -->
5422 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5423 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5424 <label for="ays-chart-option-description-italic" class="form-label">
5425 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5426 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5427 <i class="ays_fa ays_fa_info_circle"></i>
5428 </a>
5429 </label>
5430 </div>
5431 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5432 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5433 <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); ?> >
5434 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5435 </label>
5436 </div>
5437 </div> <!-- Description italic -->
5438 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5439 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5440 <label for="ays-chart-option-description-position">
5441 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5442 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5443 <i class="ays_fa ays_fa_info_circle"></i>
5444 </a>
5445 </label>
5446 </div>
5447 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5448 <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]">
5449 <?php
5450 foreach ( $title_positions as $option_slug => $option ):
5451 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5452 ?>
5453 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5454 <?php
5455 endforeach;
5456 ?>
5457 </select>
5458 </div>
5459 </div> <!-- Description position -->
5460 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5461 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5462 <label for="ays-chart-option-description-text-transform">
5463 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5464 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5465 <i class="ays_fa ays_fa_info_circle"></i>
5466 </a>
5467 </label>
5468 </div>
5469 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5470 <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]">
5471 <?php
5472 foreach ( $text_transforms as $option_slug => $option ):
5473 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5474 ?>
5475 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5476 <?php
5477 endforeach;
5478 ?>
5479 </select>
5480 </div>
5481 </div> <!-- description text transform -->
5482 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5483 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5484 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5485 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5486 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5487 <i class="ays_fa ays_fa_info_circle"></i>
5488 </a>
5489 </label>
5490 </div>
5491 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5492 <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) ?>">
5493 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5494 </div>
5495 </div> <!-- Chart description letter spacing -->
5496 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5497 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5498 <label for="ays-chart-option-description-text-decoration">
5499 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5500 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5501 <i class="ays_fa ays_fa_info_circle"></i>
5502 </a>
5503 </label>
5504 </div>
5505 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5506 <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]">
5507 <?php
5508 foreach ( $text_decorations as $option_slug => $option ):
5509 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5510 ?>
5511 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5512 <?php
5513 endforeach;
5514 ?>
5515 </select>
5516 </div>
5517 </div> <!-- description text decoration -->
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-text-shadow" class="form-label">
5521 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5522 <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") ); ?>">
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-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); ?> >
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 bold -->
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-shadow-color">
5537 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5538 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color 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) ?>input-align-right">
5544 <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) ?>">
5545 </div>
5546 </div> <!-- Chart title color -->
5547 </div>
5548 </div>
5549 <?php
5550 $content = ob_get_clean();
5551
5552 $title = __( 'Description', "chart-builder" );
5553
5554 $sources['description'] = array(
5555 'content' => $content,
5556 'title' => $title
5557 );
5558
5559 return $sources;
5560 }
5561
5562 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
5563 $html_class_prefix = $args['html_class_prefix'];
5564 $html_name_prefix = $args['html_name_prefix'];
5565 $settings = $args['settings'];
5566
5567 $description_color = $settings['description_color'];
5568 $description_font_size = $settings['description_font_size'];
5569 $title_positions = $settings['title_positions'];
5570 $description_position = $settings['description_position'];
5571 $description_bold = $settings['description_bold'];
5572 $description_text_shadow = $settings['description_text_shadow'];
5573 $description_shadow_color = $settings['description_shadow_color'];
5574 $description_italic = $settings['description_italic'];
5575 $text_transforms = $settings['text_transforms'];
5576 $text_decorations = $settings['text_decorations'];
5577 $description_text_transform = $settings['description_text_transform'];
5578 $description_text_decoration = $settings['description_text_decoration'];
5579 $description_letter_spacing = $settings['description_letter_spacing'];
5580
5581 ob_start();
5582 ?>
5583 <div class="ays-accordion-data-main-wrap">
5584 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5585 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5586 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5587 <label for="ays-chart-option-description-color">
5588 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5589 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5590 <i class="ays_fa ays_fa_info_circle"></i>
5591 </a>
5592 </label>
5593 </div>
5594 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5595 <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) ?>">
5596 </div>
5597 </div> <!-- Chart description color -->
5598 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5599 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5600 <label for="ays-chart-option-description-font-size" class="form-label">
5601 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5602 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5603 <i class="ays_fa ays_fa_info_circle"></i>
5604 </a>
5605 </label>
5606 </div>
5607 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5608 <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) ?>">
5609 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5610 </div>
5611 </div> <!-- Chart description font size -->
5612 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5613 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5614 <label for="ays-chart-option-description-bold" class="form-label">
5615 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5616 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5617 <i class="ays_fa ays_fa_info_circle"></i>
5618 </a>
5619 </label>
5620 </div>
5621 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5622 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5623 <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); ?> >
5624 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5625 </label>
5626 </div>
5627 </div> <!-- Description bold -->
5628 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5629 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5630 <label for="ays-chart-option-description-italic" class="form-label">
5631 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5632 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5633 <i class="ays_fa ays_fa_info_circle"></i>
5634 </a>
5635 </label>
5636 </div>
5637 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5638 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5639 <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); ?> >
5640 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5641 </label>
5642 </div>
5643 </div> <!-- Description italic -->
5644 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5645 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5646 <label for="ays-chart-option-description-position">
5647 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5648 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5649 <i class="ays_fa ays_fa_info_circle"></i>
5650 </a>
5651 </label>
5652 </div>
5653 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5654 <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]">
5655 <?php
5656 foreach ( $title_positions as $option_slug => $option ):
5657 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5658 ?>
5659 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5660 <?php
5661 endforeach;
5662 ?>
5663 </select>
5664 </div>
5665 </div> <!-- Description position -->
5666 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5667 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5668 <label for="ays-chart-option-description-text-transform">
5669 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5670 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5671 <i class="ays_fa ays_fa_info_circle"></i>
5672 </a>
5673 </label>
5674 </div>
5675 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5676 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_transform]">
5677 <?php
5678 foreach ( $text_transforms as $option_slug => $option ):
5679 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5680 ?>
5681 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5682 <?php
5683 endforeach;
5684 ?>
5685 </select>
5686 </div>
5687 </div> <!-- description text transform -->
5688 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5689 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5690 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5691 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5692 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5693 <i class="ays_fa ays_fa_info_circle"></i>
5694 </a>
5695 </label>
5696 </div>
5697 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5698 <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) ?>">
5699 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5700 </div>
5701 </div> <!-- Chart description letter spacing -->
5702 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5703 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5704 <label for="ays-chart-option-description-text-decoration">
5705 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5706 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5707 <i class="ays_fa ays_fa_info_circle"></i>
5708 </a>
5709 </label>
5710 </div>
5711 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5712 <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]">
5713 <?php
5714 foreach ( $text_decorations as $option_slug => $option ):
5715 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5716 ?>
5717 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5718 <?php
5719 endforeach;
5720 ?>
5721 </select>
5722 </div>
5723 </div> <!-- description text decoration -->
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-text-shadow" class="form-label">
5727 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5728 <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") ); ?>">
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-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); ?> >
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 bold -->
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-shadow-color">
5743 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5744 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color 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) ?>input-align-right">
5750 <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) ?>">
5751 </div>
5752 </div> <!-- Chart title color -->
5753 </div>
5754 </div>
5755 <?php
5756 $content = ob_get_clean();
5757
5758 $title = __( 'Description', "chart-builder" );
5759
5760 $sources['description'] = array(
5761 'content' => $content,
5762 'title' => $title
5763 );
5764
5765 return $sources;
5766 }
5767
5768 /**
5769 * Chart page settings contents
5770 * @param $args
5771 */
5772 public function ays_chart_page_advanced_settings_contents( $args ){
5773 $chart_source_type = $args['chart_source_type'];
5774
5775 if ($chart_source_type === 'chart-js') {
5776 if ($args['source_chart_type'] !== 'pie_chart') {return;}
5777 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
5778 } else {
5779 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
5780 }
5781
5782 $sources = array();
5783 foreach ( $sources_contents as $key => $sources_content ) {
5784 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
5785
5786 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
5787 if(isset($sources_content['title'])){
5788 $content .= '<legend class="ays-accordion-options-header">';
5789 $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">
5790 <g>
5791 <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" />
5792 </g>
5793 </svg>';
5794
5795 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
5796 }
5797
5798 $content .= '<div class="ays-accordion-options-content">';
5799 $content .= $sources_content['content'];
5800 $content .= '</div>';
5801
5802 $content .= '</fieldset>';
5803
5804 $sources[] = $content;
5805 }
5806 $content_for_escape = implode('' , $sources );
5807 echo html_entity_decode(esc_html( $content_for_escape ));
5808 }
5809
5810 public function settings_contents_advanced_settings( $sources, $args ){
5811 $html_class_prefix = $args['html_class_prefix'];
5812 $html_name_prefix = $args['html_name_prefix'];
5813 $settings = $args['settings'];
5814 $tab_title = $args['tab_name'];
5815
5816 $rotation_degree = $settings['rotation_degree'];
5817 $reverse_categories = $settings['reverse_categories'];
5818 $slice_border_color = $settings['slice_border_color'];
5819 $slice_texts = $settings['slice_texts'];
5820 $slice_text = $settings['slice_text'];
5821 $tooltip_text_options = $settings['tooltip_text_options'];
5822 $tooltip_text = $settings['tooltip_text'];
5823 $is_stacked = $settings['is_stacked'];
5824 $focus_target_options = $settings['focus_target_options'];
5825 $focus_target = $settings['focus_target'];
5826 $multiple_data_format_options = $settings['multiple_data_format_options'];
5827 $multiple_data_format = $settings['multiple_data_format'];
5828 $opacity = $settings['opacity'];
5829 $group_width = $settings['group_width'];
5830 $group_width_format = $settings['group_width_format'];
5831 $group_width_format_options = $settings['group_width_format_options'];
5832 $line_width = $settings['line_width'];
5833 $data_grouping_limit = $settings['data_grouping_limit'];
5834 $data_grouping_label = $settings['data_grouping_label'];
5835 $data_grouping_color = $settings['data_grouping_color'];
5836 $multiple_selection = $settings['multiple_selection'];
5837 $point_shape_options = $settings['point_shape_options'];
5838 $point_shape = $settings['point_shape'];
5839 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
5840 $crosshair_trigger = $settings['crosshair_trigger'];
5841 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
5842 $crosshair_orientation = $settings['crosshair_orientation'];
5843 $crosshair_opacity = $settings['crosshair_opacity'];
5844 $dash_style = $settings['dash_style'];
5845 $point_size = $settings['point_size'];
5846 $donut_hole_size = $settings['donut_hole_size'];
5847 $orientation = $settings['orientation'];
5848 $fill_nulls = $settings['fill_nulls'];
5849 $allow_collapse = $settings['allow_collapse'];
5850 $org_classname = $settings['org_classname'];
5851 $org_node_background_color = $settings['org_node_background_color'];
5852 $org_node_padding = $settings['org_node_padding'];
5853 $org_node_border_radius = $settings['org_node_border_radius'];
5854 $org_node_border_width = $settings['org_node_border_width'];
5855 $org_node_border_color = $settings['org_node_border_color'];
5856 $org_node_text_color = $settings['org_node_text_color'];
5857 $org_node_text_font_size = $settings['org_node_text_font_size'];
5858 $org_node_description_font_color = $settings['org_node_description_font_color'];
5859 $org_node_description_font_size = $settings['org_node_description_font_size'];
5860 $org_selected_classname = $settings['org_selected_classname'];
5861 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
5862 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
5863
5864 ob_start();
5865 ?>
5866 <div class="ays-accordion-data-main-wrap">
5867 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
5868 <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">
5869 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5870 <label for="ays-chart-option-rotation-degree" class="form-label">
5871 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
5872 <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") ); ?>">
5873 <i class="ays_fa ays_fa_info_circle"></i>
5874 </a>
5875 </label>
5876 </div>
5877 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5878 <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) ?>">
5879 </div>
5880 </div> <!-- Rotation degree -->
5881 <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">
5882 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5883 <label for="ays-chart-option-reverse-categories">
5884 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
5885 <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") ); ?>">
5886 <i class="ays_fa ays_fa_info_circle"></i>
5887 </a>
5888 </label>
5889 </div>
5890 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5891 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5892 <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); ?> >
5893 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5894 </label>
5895 </div>
5896 </div> <!-- Reverse Categories -->
5897 <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">
5898 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5899 <label for="ays-chart-option-slice-border-color">
5900 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
5901 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
5902 <i class="ays_fa ays_fa_info_circle"></i>
5903 </a>
5904 </label>
5905 </div>
5906 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5907 <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) ?>">
5908 </div>
5909 </div> <!-- Slice border color -->
5910 <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">
5911 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5912 <label for="ays-chart-option-slice-text">
5913 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
5914 <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") ); ?>">
5915 <i class="ays_fa ays_fa_info_circle"></i>
5916 </a>
5917 </label>
5918 </div>
5919 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5920 <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]">
5921 <?php
5922 foreach ( $slice_texts as $option_slug => $option ):
5923 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
5924 ?>
5925 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5926 <?php
5927 endforeach;
5928 ?>
5929 </select>
5930 </div>
5931 </div> <!-- Slice text -->
5932 <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">
5933 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5934 <label for="ays-chart-option-tooltip-text">
5935 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
5936 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
5937 <i class="ays_fa ays_fa_info_circle"></i>
5938 </a>
5939 </label>
5940 </div>
5941 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5942 <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]">
5943 <?php
5944 foreach ( $tooltip_text_options as $option_slug => $option ):
5945 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
5946 ?>
5947 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5948 <?php
5949 endforeach;
5950 ?>
5951 </select>
5952 </div>
5953 </div> <!-- Slice tooltip Text -->
5954 <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">
5955 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5956 <label for="ays-chart-option-data-grouping-limit" class="form-label">
5957 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
5958 <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") ); ?>">
5959 <i class="ays_fa ays_fa_info_circle"></i>
5960 </a>
5961 </label>
5962 </div>
5963 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5964 <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">
5965 </div>
5966 </div> <!-- Data Grouping Limit -->
5967 <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">
5968 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5969 <label for="ays-chart-option-data-grouping-label" class="form-label">
5970 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
5971 <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") ); ?>">
5972 <i class="ays_fa ays_fa_info_circle"></i>
5973 </a>
5974 </label>
5975 </div>
5976 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5977 <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) ?>">
5978 </div>
5979 </div> <!-- Data Grouping Label -->
5980 <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">
5981 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5982 <label for="ays-chart-option-data-grouping-color">
5983 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
5984 <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") ); ?>">
5985 <i class="ays_fa ays_fa_info_circle"></i>
5986 </a>
5987 </label>
5988 </div>
5989 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5990 <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) ?>">
5991 </div>
5992 </div> <!-- Data Grouping Color -->
5993 <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">
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-is-stacked">
5996 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
5997 <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") ); ?>">
5998 <i class="ays_fa ays_fa_info_circle"></i>
5999 </a>
6000 </label>
6001 </div>
6002 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6003 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6004 <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); ?> >
6005 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6006 </label>
6007 </div>
6008 </div> <!-- Is stacked -->
6009 <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">
6010 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6011 <label for="ays-chart-option-focus-target">
6012 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6013 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6014 echo htmlspecialchars( sprintf(
6015 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6016 __('%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>" .
6017 __('%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>",
6018 '<em>',
6019 '</em>',
6020 '<em>',
6021 '</em>'
6022 ) );
6023 ?>">
6024 <i class="ays_fa ays_fa_info_circle"></i>
6025 </a>
6026 </label>
6027 </div>
6028 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6029 <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]">
6030 <?php
6031 foreach ( $focus_target_options as $option_slug => $option ):
6032 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6033 ?>
6034 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6035 <?php
6036 endforeach;
6037 ?>
6038 </select>
6039 </div>
6040 </div> <!-- Focus target -->
6041 <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">
6042 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6043 <label for="ays-chart-option-opacity" class="form-label">
6044 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6045 <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") ); ?>">
6046 <i class="ays_fa ays_fa_info_circle"></i>
6047 </a>
6048 </label>
6049 </div>
6050 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6051 <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">
6052 </div>
6053 </div> <!-- Data opacity -->
6054 <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">
6055 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6056 <label for="ays-chart-option-group-width">
6057 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6058 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6059 echo htmlspecialchars( sprintf(
6060 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6061 __('%sPixels:%s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6062 __('%sPercentage:%s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6063 '<em>',
6064 '</em>',
6065 '<em>',
6066 '</em>'
6067 ) );
6068 ?>">
6069 <i class="ays_fa ays_fa_info_circle"></i>
6070 </a>
6071 </label>
6072 </div>
6073 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6074 <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) ?>">
6075 <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]">
6076 <?php
6077 foreach ( $group_width_format_options as $option_slug => $option ):
6078 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6079 ?>
6080 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6081 <?php
6082 endforeach;
6083 ?>
6084 </select>
6085 </div>
6086 </div> <!-- Bars width -->
6087 <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">
6088 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6089 <label for="ays-chart-option-line-width" class="form-label">
6090 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6091 <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") ); ?>">
6092 <i class="ays_fa ays_fa_info_circle"></i>
6093 </a>
6094 </label>
6095 </div>
6096 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6097 <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) ?>">
6098 </div>
6099 </div> <!-- Line width -->
6100 <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">
6101 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6102 <label for="ays-chart-option-multiple-selection">
6103 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6104 <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") ); ?>">
6105 <i class="ays_fa ays_fa_info_circle"></i>
6106 </a>
6107 </label>
6108 </div>
6109 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6110 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6111 <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); ?> >
6112 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6113 </label>
6114 </div>
6115 </div> <!-- Multiple data selection -->
6116 <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">
6117 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6118 <label for="ays-chart-option-multiple-data-format">
6119 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6120 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6121 echo htmlspecialchars( sprintf(
6122 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6123 __('%sCategory:%s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6124 __('%sSeries:%s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6125 __('%sAuto:%s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6126 __('%sNone:%s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6127 '<em>',
6128 '</em>',
6129 '<em>',
6130 '</em>',
6131 '<em>',
6132 '</em>',
6133 '<em>',
6134 '</em>'
6135 ) );
6136 ?>">
6137 <i class="ays_fa ays_fa_info_circle"></i>
6138 </a>
6139 </label>
6140 </div>
6141 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6142 <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]">
6143 <?php
6144 foreach ( $multiple_data_format_options as $option_slug => $option ):
6145 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6146 ?>
6147 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6148 <?php
6149 endforeach;
6150 ?>
6151 </select>
6152 </div>
6153 </div> <!-- Multiple data format -->
6154 <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">
6155 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6156 <label for="ays-chart-option-point-shape">
6157 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6158 <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") ); ?>">
6159 <i class="ays_fa ays_fa_info_circle"></i>
6160 </a>
6161 </label>
6162 </div>
6163 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6164 <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]">
6165 <?php
6166 foreach ( $point_shape_options as $option_slug => $option ):
6167 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6168 ?>
6169 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6170 <?php
6171 endforeach;
6172 ?>
6173 </select>
6174 </div>
6175 </div> <!-- Point shape -->
6176 <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">
6177 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6178 <label for="ays-chart-option-point-size" class="form-label">
6179 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6180 <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") ); ?>">
6181 <i class="ays_fa ays_fa_info_circle"></i>
6182 </a>
6183 </label>
6184 </div>
6185 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6186 <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) ?>">
6187 </div>
6188 </div> <!-- Point size -->
6189 <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">
6190 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6191 <label for="ays-chart-option-orientation">
6192 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6193 <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") ); ?>">
6194 <i class="ays_fa ays_fa_info_circle"></i>
6195 </a>
6196 </label>
6197 </div>
6198 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6199 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6200 <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); ?> >
6201 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6202 </label>
6203 </div>
6204 </div> <!-- Orientation -->
6205 <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">
6206 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6207 <label for="ays-chart-option-fill-nulls">
6208 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6209 <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") ); ?>">
6210 <i class="ays_fa ays_fa_info_circle"></i>
6211 </a>
6212 </label>
6213 </div>
6214 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6215 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6216 <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); ?> >
6217 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6218 </label>
6219 </div>
6220 </div> <!-- Autofill nulls -->
6221 <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">
6222 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6223 <label for="ays-chart-option-crosshair-trigger">
6224 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6225 <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") ); ?>">
6226 <i class="ays_fa ays_fa_info_circle"></i>
6227 </a>
6228 </label>
6229 </div>
6230 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6231 <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]">
6232 <?php
6233 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6234 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6235 ?>
6236 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6237 <?php
6238 endforeach;
6239 ?>
6240 </select>
6241 </div>
6242 </div> <!-- Crosshair trigger -->
6243 <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">
6244 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6245 <label for="ays-chart-option-crosshair-orientation">
6246 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6247 <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") ); ?>">
6248 <i class="ays_fa ays_fa_info_circle"></i>
6249 </a>
6250 </label>
6251 </div>
6252 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6253 <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]">
6254 <?php
6255 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6256 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6257 ?>
6258 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6259 <?php
6260 endforeach;
6261 ?>
6262 </select>
6263 </div>
6264 </div> <!-- Crosshair orientation -->
6265 <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">
6266 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6267 <label for="ays-chart-option-crosshair-opacity" class="form-label">
6268 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
6269 <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") ); ?>">
6270 <i class="ays_fa ays_fa_info_circle"></i>
6271 </a>
6272 </label>
6273 </div>
6274 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6275 <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">
6276 </div>
6277 </div> <!-- Crosshair opacity -->
6278 <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">
6279 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6280 <label for="ays-chart-option-dash-style" class="form-label">
6281 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
6282 <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") ); ?>">
6283 <i class="ays_fa ays_fa_info_circle"></i>
6284 </a>
6285 </label>
6286 </div>
6287 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6288 <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) ?>">
6289 </div>
6290 </div> <!-- Line dash pattern -->
6291 <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">
6292 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6293 <label for="ays-chart-option-donut-hole-size">
6294 <?php echo __( "Hole size", $this->plugin_name ); ?>
6295 </label>
6296 </div>
6297 <div class="col-sm-7 <?= $html_class_prefix ?>input-align-right <?= $html_class_prefix ?>option-input">
6298 <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 ?>">
6299 </div>
6300 </div> <!-- Donut hole size -->
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 ays-pro-features-v2-main-box">
6302 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6303 <div class="ays-pro-features-v2-video-button"></div>
6304 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6305 <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>
6306 <div class="ays-pro-features-v2-upgrade-text">
6307 <?php echo __("Upgrade" , "chart-builder"); ?>
6308 </div>
6309 </a>
6310 </div>
6311 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6312 <label for="ays-chart-option-curve-type">
6313 <?php echo __( "Line curve type", "chart-builder" ); ?>
6314 </label>
6315 </div>
6316 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6317 <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]">
6318 <option><?php echo __( "Straight", "chart-builder" ); ?></option>
6319 </select>
6320 </div>
6321 </div> <!-- Line curve type -->
6322 <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">
6323 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6324 <label for="ays-chart-option-allow-collapse">
6325 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
6326 <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") ); ?>">
6327 <i class="ays_fa ays_fa_info_circle"></i>
6328 </a>
6329 </label>
6330 </div>
6331 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6332 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6333 <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); ?> >
6334 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6335 </label>
6336 </div>
6337 </div> <!-- Allow collapse -->
6338 <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">
6339 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6340 <label for="ays-chart-option-org-node-description-font-color">
6341 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
6342 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
6343 <i class="ays_fa ays_fa_info_circle"></i>
6344 </a>
6345 </label>
6346 </div>
6347 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6348 <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) ?>">
6349 </div>
6350 </div> <!-- Org Node Description color -->
6351 <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">
6352 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6353 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
6354 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
6355 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
6356 <i class="ays_fa ays_fa_info_circle"></i>
6357 </a>
6358 </label>
6359 </div>
6360 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6361 <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) ?>">
6362 </div>
6363 </div> <!-- Org Node Description font size -->
6364 <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">
6365 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6366 <label for="ays-chart-option-org-classname" class="form-label">
6367 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
6368 <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") ); ?>">
6369 <i class="ays_fa ays_fa_info_circle"></i>
6370 </a>
6371 </label>
6372 </div>
6373 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6374 <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) ?>">
6375 </div>
6376 </div> <!-- Org custom class -->
6377 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6378 <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">
6379 <br>
6380 <blockquote>
6381 <?php echo sprintf(__( "%sNote:%s Custom CSS class must be set for the options below to take effect.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6382 </blockquote>
6383 <br>
6384 </div>
6385 <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">
6386 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6387 <label for="ays-chart-option-org-node-background-color">
6388 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6389 <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") ); ?>">
6390 <i class="ays_fa ays_fa_info_circle"></i>
6391 </a>
6392 </label>
6393 </div>
6394 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6395 <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) ?>">
6396 </div>
6397 </div> <!-- Org Node Background color -->
6398 <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">
6399 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6400 <label for="ays-chart-option-org-node-padding" class="form-label">
6401 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
6402 <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") ); ?>">
6403 <i class="ays_fa ays_fa_info_circle"></i>
6404 </a>
6405 </label>
6406 </div>
6407 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6408 <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) ?>">
6409 </div>
6410 </div> <!-- Org Node Padding -->
6411 <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">
6412 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6413 <label for="ays-chart-option-org-node-border-radius" class="form-label">
6414 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
6415 <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") ); ?>">
6416 <i class="ays_fa ays_fa_info_circle"></i>
6417 </a>
6418 </label>
6419 </div>
6420 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6421 <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) ?>">
6422 </div>
6423 </div> <!-- Org Node Border radius -->
6424 <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">
6425 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6426 <label for="ays-chart-option-org-node-border-width" class="form-label">
6427 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
6428 <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") ); ?>">
6429 <i class="ays_fa ays_fa_info_circle"></i>
6430 </a>
6431 </label>
6432 </div>
6433 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6434 <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) ?>">
6435 </div>
6436 </div> <!-- Org Node Border width -->
6437 <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">
6438 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6439 <label for="ays-chart-option-org-node-border-color">
6440 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
6441 <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") ); ?>">
6442 <i class="ays_fa ays_fa_info_circle"></i>
6443 </a>
6444 </label>
6445 </div>
6446 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6447 <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) ?>">
6448 </div>
6449 </div> <!-- Org Node Background color -->
6450 <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">
6451 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6452 <label for="ays-chart-option-org-node-text-color">
6453 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6454 <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") ); ?>">
6455 <i class="ays_fa ays_fa_info_circle"></i>
6456 </a>
6457 </label>
6458 </div>
6459 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6460 <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) ?>">
6461 </div>
6462 </div> <!-- Org Node Text color -->
6463 <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">
6464 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6465 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
6466 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
6467 <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") ); ?>">
6468 <i class="ays_fa ays_fa_info_circle"></i>
6469 </a>
6470 </label>
6471 </div>
6472 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6473 <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) ?>">
6474 </div>
6475 </div> <!-- Org Node Text font size -->
6476 </div> <!-- Org custom class options -->
6477 <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">
6478 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6479 <label for="ays-chart-option-org-selected-classname" class="form-label">
6480 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
6481 <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") ); ?>">
6482 <i class="ays_fa ays_fa_info_circle"></i>
6483 </a>
6484 </label>
6485 </div>
6486 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6487 <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) ?>">
6488 </div>
6489 </div> <!-- Org custom selected class -->
6490 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6491 <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">
6492 <br>
6493 <blockquote>
6494 <?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>'); ?>
6495 </blockquote>
6496 <br>
6497 </div>
6498 <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">
6499 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6500 <label for="ays-chart-option-org-selected-node-background-color">
6501 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6502 <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") ); ?>">
6503 <i class="ays_fa ays_fa_info_circle"></i>
6504 </a>
6505 </label>
6506 </div>
6507 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6508 <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) ?>">
6509 </div>
6510 </div> <!-- Org selected Node Background color -->
6511 <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">
6512 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6513 <label for="ays-chart-option-org-selected-node-text-color">
6514 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6515 <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") ); ?>">
6516 <i class="ays_fa ays_fa_info_circle"></i>
6517 </a>
6518 </label>
6519 </div>
6520 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6521 <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) ?>">
6522 </div>
6523 </div> <!-- Org selected Node text color -->
6524 </div> <!-- Org custom selected class options -->
6525 </div>
6526 </div>
6527 <?php
6528 $content = ob_get_clean();
6529
6530 $sources['advanced_settings'] = array(
6531 'content' => $content,
6532 'title' => $tab_title
6533 );
6534
6535 return $sources;
6536 }
6537
6538 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
6539 $html_class_prefix = $args['html_class_prefix'];
6540 $html_name_prefix = $args['html_name_prefix'];
6541 $settings = $args['settings'];
6542 $tab_title = $args['tab_name'];
6543
6544 $outer_radius = $settings['outer_radius'];
6545 $slice_spacing = $settings['slice_spacing'];
6546 $circumference = $settings['circumference'];
6547 $start_angle = $settings['start_angle'];
6548 // $index_axis = $settings['index_axis'];
6549
6550 ob_start();
6551 ?>
6552 <div class="ays-accordion-data-main-wrap">
6553 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6554 <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">
6555 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6556 <label for="ays-chart-option-outer-radius" class="form-label">
6557 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
6558 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
6559 <i class="ays_fa ays_fa_info_circle"></i>
6560 </a>
6561 </label>
6562 </div>
6563 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6564 <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) ?>">
6565 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6566 </div>
6567 </div> <!-- Outer Radius -->
6568 <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">
6569 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6570 <label for="ays-chart-option-slice-spacing" class="form-label">
6571 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
6572 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
6573 <i class="ays_fa ays_fa_info_circle"></i>
6574 </a>
6575 </label>
6576 </div>
6577 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6578 <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) ?>">
6579 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6580 </div>
6581 </div> <!-- Slice Spacing -->
6582 <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">
6583 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6584 <label for="ays-chart-option-circumference" class="form-label">
6585 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
6586 <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") ); ?>">
6587 <i class="ays_fa ays_fa_info_circle"></i>
6588 </a>
6589 </label>
6590 </div>
6591 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6592 <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) ?>">
6593 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6594 </div>
6595 </div> <!-- Arc Coverage -->
6596 <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">
6597 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6598 <label for="ays-chart-option-start-angle" class="form-label">
6599 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
6600 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
6601 <i class="ays_fa ays_fa_info_circle"></i>
6602 </a>
6603 </label>
6604 </div>
6605 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6606 <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) ?>">
6607 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6608 </div>
6609 </div> <!-- Start Angle -->
6610 <!-- <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">
6611 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
6612 <label for="ays-chart-option-index-axis">
6613 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
6614 <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") ); ?>">
6615 <i class="ays_fa ays_fa_info_circle"></i>
6616 </a>
6617 </label>
6618 </div>
6619 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
6620 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6621 <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); ?> >
6622 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6623 </label>
6624 </div>
6625 </div> Reverse Categories -->
6626 </div>
6627 </div>
6628 <?php
6629 $content = ob_get_clean();
6630
6631 $sources['advanced_settings'] = array(
6632 'content' => $content,
6633 'title' => $tab_title
6634 );
6635
6636 return $sources;
6637 }
6638
6639 public function settings_contents_slices_settings( $sources, $args ){
6640 $html_class_prefix = $args['html_class_prefix'];
6641 $html_name_prefix = $args['html_name_prefix'];
6642 $settings = $args['settings'];
6643 $source = $args['source'];
6644 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6645 $source_chart_type = $args['source_chart_type'];
6646 $settings = $args['settings'];
6647 $title_row = array_shift($source);
6648
6649 if (isset($source) && !empty($source)) {
6650 if ( !isset( $source[0] ) ) {
6651 if (count($source[1]) > 2) {
6652 $titles = array();
6653 for ($i = 0; $i < count($source[1]); $i++) {
6654 array_push($titles, __("Title", $this->plugin_name).$i);
6655 }
6656 $source[0] = $titles;
6657 } else {
6658 $source[0] = array(
6659 __("Country", $this->plugin_name),
6660 __("Population", $this->plugin_name),
6661 );
6662 }
6663
6664 ksort($source);
6665 }
6666 }
6667
6668 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6669 foreach ($source as $key => $row) {
6670 $source[$key] = array_slice($row, 0, 2);
6671 }
6672 }
6673
6674 ob_start();
6675 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6676 $slice_color = $settings['slice_color'];
6677 $slice_colors_default = $settings['slice_colors_default'];
6678 $slice_offset = $settings['slice_offset'];
6679 $slice_text_color = $settings['slice_text_color'];
6680
6681 ?>
6682 <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">
6683 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6684 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
6685 <?php
6686 foreach ( $source as $key => $val ):
6687 ?>
6688 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
6689 <legend class="ays-slices-accordion-options-header">
6690 <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">
6691 <g>
6692 <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" />
6693 </g>
6694 </svg>
6695 <span><?php echo $val[0]; ?></span>
6696 </legend>
6697 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
6698 <div class="ays-slices-accordion-data-main-wrap">
6699 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6700 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6701 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6702 <label for="ays-chart-option-slice-color">
6703 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6704 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for this slice.","chart-builder") ); ?>">
6705 <i class="ays_fa ays_fa_info_circle"></i>
6706 </a>
6707 </label>
6708 </div>
6709 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6710 <input type="color"
6711 id="ays-chart-option-slice-color-<?php echo $key; ?>"
6712 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6713 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo $key; ?>]"
6714 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : $slice_colors_default[$key]; ?>"
6715 data-slice-id="<?php echo $key; ?>">
6716 </div>
6717 </div> <!-- Slice color -->
6718 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6719 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6720 <label for="ays-chart-option-slice-offset" class="form-label">
6721 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
6722 <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") ); ?>">
6723 <i class="ays_fa ays_fa_info_circle"></i>
6724 </a>
6725 </label>
6726 </div>
6727 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6728 <input type="number"
6729 id="ays-chart-option-slice-offset-<?php echo $key; ?>"
6730 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
6731 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo $key; ?>]"
6732 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
6733 data-slice-id="<?php echo $key; ?>"
6734 step=".01" min="0.0" max="1.0">
6735 </div>
6736 </div> <!-- Slice offset -->
6737 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6738 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6739 <label for="ays-chart-option-slice-text-color">
6740 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6741 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for the text of this slice.","chart-builder") ); ?>">
6742 <i class="ays_fa ays_fa_info_circle"></i>
6743 </a>
6744 </label>
6745 </div>
6746 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6747 <input type="color"
6748 id="ays-chart-option-slice-text-color-<?php echo $key; ?>"
6749 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6750 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo $key; ?>]"
6751 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
6752 data-slice-id="<?php echo $key; ?>">
6753 </div>
6754 </div> <!-- Slice color -->
6755 </div>
6756 </div>
6757 </div>
6758 </fieldset>
6759 <?php
6760 endforeach;
6761 ?>
6762 </div>
6763 </div>
6764 <br>
6765 <blockquote>
6766 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
6767 </blockquote>
6768 </div>
6769 <?php
6770
6771 } else {
6772 ?>
6773 <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>
6774 <?php
6775 }
6776
6777 $content = ob_get_clean();
6778
6779 $title = __( 'Slices settings', "chart-builder" );
6780
6781 $sources['slices_settings'] = array(
6782 'content' => $content,
6783 'title' => $title
6784 );
6785
6786 return $sources;
6787 }
6788
6789 public function settings_contents_series_settings( $sources, $args ){
6790 $html_class_prefix = $args['html_class_prefix'];
6791 $html_name_prefix = $args['html_name_prefix'];
6792 $settings = $args['settings'];
6793 $source = $args['source'];
6794 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6795 $source_chart_type = $args['source_chart_type'];
6796
6797 $line_width = $settings['line_width'];
6798 $point_size = $settings['point_size'];
6799 $point_shape_options = $settings['point_shape_options'];
6800 $point_shape = $settings['point_shape'];
6801
6802 if (isset($source) && !empty($source)) {
6803 if ( !isset( $source[0] ) ) {
6804 if (count($source[1]) > 2) {
6805 $titles = array();
6806 for ($i = 0; $i < count($source[1]); $i++) {
6807 array_push($titles, __("Title", $this->plugin_name).$i);
6808 }
6809 $source[0] = $titles;
6810 } else {
6811 $source[0] = array(
6812 __("Country", $this->plugin_name),
6813 __("Population", $this->plugin_name),
6814 );
6815 }
6816
6817 ksort($source);
6818 }
6819 }
6820
6821 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6822 foreach ($source as $key => $row) {
6823 $source[$key] = array_slice($row, 0, 2);
6824 }
6825 }
6826
6827 ob_start();
6828 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
6829 $series_row = array_shift($source);
6830 $title = array_shift($series_row);
6831 $series_color = $settings['series_color'];
6832 $series_colors_default = $settings['series_colors_default'];
6833 $series_visible_in_legend = $settings['series_visible_in_legend'];
6834 $series_line_width = $settings['series_line_width'];
6835 $series_point_size = $settings['series_point_size'];
6836 $series_point_shape = $settings['series_point_shape'];
6837
6838 ?>
6839 <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">
6840 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6841 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
6842 <?php
6843 foreach ( $series_row as $key => $val ):
6844 ?>
6845 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
6846 <legend class="ays-series-accordion-options-header">
6847 <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">
6848 <g>
6849 <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" />
6850 </g>
6851 </svg>
6852 <span><?php echo $val; ?></span>
6853 </legend>
6854 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
6855 <div class="ays-series-accordion-data-main-wrap">
6856 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6857 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6858 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6859 <label for="ays-chart-option-series-color">
6860 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6861 </label>
6862 </div>
6863 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6864 <input type="color"
6865 id="ays-chart-option-series-color-<?php echo $key; ?>"
6866 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6867 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo $key; ?>]"
6868 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : $series_colors_default[$key]; ?>"
6869 data-series-id="<?php echo $key; ?>">
6870 </div>
6871 </div> <!-- series color -->
6872 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6873 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6874 <label for="ays-chart-option-series-visible-in-legend">
6875 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
6876 <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") ); ?>">
6877 <i class="ays_fa ays_fa_info_circle"></i>
6878 </a>
6879 </label>
6880 </div>
6881 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6882 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6883 <input type="checkbox"
6884 id="ays-chart-option-series-visible-in-legend-<?php echo $key; ?>"
6885 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
6886 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo $key; ?>]"
6887 value="on"
6888 data-series-id="<?php echo $key; ?>"
6889 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
6890 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6891 </label>
6892 </div>
6893 </div> <!-- Series visible in legend -->
6894 <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">
6895 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6896 <label for="ays-chart-option-series-line-width">
6897 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6898 <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") ); ?>">
6899 <i class="ays_fa ays_fa_info_circle"></i>
6900 </a>
6901 </label>
6902 </div>
6903 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6904 <input type="number"
6905 id="ays-chart-option-series-line-width-<?php echo $key; ?>"
6906 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
6907 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo $key; ?>]"
6908 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : $line_width; ?>"
6909 data-series-id="<?php echo $key; ?>">
6910 </div>
6911 </div> <!-- Line width -->
6912 <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">
6913 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6914 <label for="ays-chart-option-series-point-size">
6915 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6916 <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") ); ?>">
6917 <i class="ays_fa ays_fa_info_circle"></i>
6918 </a>
6919 </label>
6920 </div>
6921 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6922 <input type="number"
6923 id="ays-chart-option-series-point-size-<?php echo $key; ?>"
6924 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
6925 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo $key; ?>]"
6926 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : $point_size; ?>"
6927 data-series-id="<?php echo $key; ?>">
6928 </div>
6929 </div> <!-- Point size -->
6930 <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">
6931 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6932 <label for="ays-chart-option-series-point-shape">
6933 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6934 <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") ); ?>">
6935 <i class="ays_fa ays_fa_info_circle"></i>
6936 </a>
6937 </label>
6938 </div>
6939 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6940 <select
6941 id="ays-chart-option-series-point-shape-<?php echo $key; ?>"
6942 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
6943 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo $key; ?>]"
6944 data-series-id="<?php echo $key; ?>">
6945 >
6946 <?php
6947 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
6948 foreach ( $point_shape_options as $option_slug => $option ):
6949 $selected = ( $value === $option_slug ) ? 'selected' : '';
6950 ?>
6951 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6952 <?php
6953 endforeach;
6954 ?>
6955 </select>
6956 </div>
6957 </div> <!-- Point shape -->
6958 </div>
6959 </div>
6960 </div>
6961 </fieldset>
6962 <?php
6963 endforeach;
6964 ?>
6965 </div>
6966 </div>
6967 <br>
6968 <blockquote>
6969 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
6970 <br>
6971 <?php echo sprintf(__( "%sNote:%s If you are not able to set the options, disable the row settings feature.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6972 </blockquote>
6973 </div>
6974 <?php
6975
6976 } else {
6977 ?>
6978 <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>
6979 <?php
6980 }
6981
6982 $content = ob_get_clean();
6983
6984 $title = __( 'Series settings', "chart-builder" );
6985
6986 $sources['series_settings'] = array(
6987 'content' => $content,
6988 'title' => $title
6989 );
6990
6991 return $sources;
6992 }
6993
6994 public function settings_contents_row_settings( $sources, $args ){
6995 $html_class_prefix = $args['html_class_prefix'];
6996 $html_name_prefix = $args['html_name_prefix'];
6997 $settings = $args['settings'];
6998 $source = $args['source'];
6999 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7000 $source_chart_type = $args['source_chart_type'];
7001
7002 if (isset($source) && !empty($source)) {
7003 if ( !isset( $source[0] ) ) {
7004 if (count($source[1]) > 2) {
7005 $titles = array();
7006 for ($i = 0; $i < count($source[1]); $i++) {
7007 array_push($titles, __("Title", $this->plugin_name).$i);
7008 }
7009 $source[0] = $titles;
7010 } else {
7011 $source[0] = array(
7012 __("Country", $this->plugin_name),
7013 __("Population", $this->plugin_name),
7014 );
7015 }
7016
7017 ksort($source);
7018 }
7019 }
7020
7021 array_shift($source);
7022 $rows = array_column($source, 0);
7023
7024 $enable_row_settings = $settings['enable_row_settings'];
7025 $series_color = $settings['series_color'][0] ?? '#3366cc';
7026 $rows_color = $settings['rows_color'];
7027 $rows_opacity = $settings['rows_opacity'];
7028
7029 ob_start();
7030 ?>
7031 <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">
7032 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7033 <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">
7034 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7035 <label for="ays-chart-option-enable-row-settings">
7036 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7037 <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") ); ?>">
7038 <i class="ays_fa ays_fa_info_circle"></i>
7039 </a>
7040 </label>
7041 </div>
7042 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7043 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7044 <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); ?> >
7045 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7046 </label>
7047 </div>
7048 </div> <!-- Enable row settings -->
7049 <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'; ?>">
7050 <br>
7051 <?php
7052 foreach ( $rows as $key => $val ):
7053 ?>
7054 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7055 <legend class="ays-rows-accordion-options-header">
7056 <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">
7057 <g>
7058 <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" />
7059 </g>
7060 </svg>
7061 <span><?php echo $val; ?></span>
7062 </legend>
7063 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7064 <div class="ays-rows-accordion-data-main-wrap">
7065 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7066 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7067 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7068 <label for="ays-chart-option-rows-color">
7069 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7070 </label>
7071 </div>
7072 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7073 <input type="color"
7074 id="ays-chart-option-rows-color-<?php echo $key; ?>"
7075 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7076 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo $key; ?>]"
7077 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : $series_color; ?>"
7078 data-rows-id="<?php echo $key; ?>">
7079 </div>
7080 </div> <!-- color -->
7081 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7082 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7083 <label for="ays-chart-option-rows-color">
7084 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7085 </label>
7086 </div>
7087 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7088 <input type="number"
7089 id="ays-chart-option-rows-opacity-<?php echo $key; ?>"
7090 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7091 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo $key; ?>]"
7092 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7093 data-rows-id="<?php echo $key; ?>"
7094 step=".1" min="0" max="1">
7095 </div>
7096 </div> <!-- opacity -->
7097 </div>
7098 </div>
7099 </div>
7100 </fieldset>
7101 <?php
7102 endforeach;
7103 ?>
7104 <br>
7105 <blockquote>
7106 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7107 <br>
7108 <?php echo sprintf(__( "%sNote:%s The applied styles will work only if the chart has one column.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7109 </blockquote>
7110 </div>
7111 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7112 <br>
7113 <blockquote>
7114 <?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>'); ?>
7115 </blockquote>
7116 </div>
7117 </div>
7118 </div>
7119 <?php
7120 $content = ob_get_clean();
7121
7122 $title = __( 'Row settings', "chart-builder" );
7123
7124 $sources['row_settings'] = array(
7125 'content' => $content,
7126 'title' => $title
7127 );
7128
7129 return $sources;
7130 }
7131 }
7132