'remote', 'own' => '0', 'paths' => '', 'wrap' => '1', 'resources' => amcharts_get_available_resources(), 'custom_resources' => '', 'chart_types' => array() ); $chart_libs = amcharts_get_chart_type_libs(); foreach ( $chart_libs as $chart_type => $libs ) { $settings['chart_types'][$chart_type] = array( 'default_resources' => amcharts_get_resources( $libs, $settings['resources'] ), 'custom_resources' => 0, 'default_html' => amcharts_get_default( $chart_type, 'html' ), 'default_javascript' => amcharts_get_default( $chart_type, 'javascript' ) ); } return $settings; } function amcharts_settings_show () { // check permissions if (!current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } // unqueue required scripts and styles wp_enqueue_style( 'jquery-ui-smoothness', plugins_url( 'lib/jquery-ui/css/smoothness/jquery-ui-1.10.4.custom.min.css', AMCHARTS_BASE ), array(), AMCHARTS_VERSION ); wp_enqueue_script( 'jquery-ui-tabs' ); // get chart type settings $chart_types = amcharts_get_chart_types(); $chart_type_libs = amcharts_get_chart_type_libs(); // load current settings $settings = get_option( 'amcharts_options', amcharts_get_defaults() ); // process save $errors = array(); if ( !empty( $_POST ) && wp_verify_nonce( $_POST['amcharts_nonce'], AMCHARTS_NONCE ) ) { // save previous location setting for checking later $prev_location = $settings['location']; // get submited data $settings['own'] = isset( $_POST['own'] ) && '1' == $_POST['own'] ? '1' : '0'; $settings['wrap'] = isset( $_POST['wrap'] ) && '1' == $_POST['wrap'] ? '1' : '0'; $settings['location'] = isset( $_POST['location'] ) ? trim( $_POST['location'] ) : 'remote'; $settings['paths'] = isset( $_POST['paths'] ) ? trim( $_POST['paths'] ) : ''; $settings['custom_resources'] = isset( $_POST['custom_resources'] ) ? trim( $_POST['custom_resources'] ) : ''; reset( $chart_types ); foreach ( $chart_types as $chart_type => $chart_type_name ) { $settings['chart_types'][$chart_type] = array( 'default_resources' => trim( $_POST['chart_types'][$chart_type]['default_resources'] ), 'custom_resources' => (int) $_POST['chart_types'][$chart_type]['custom_resources'], 'default_html' => trim( $_POST['chart_types'][$chart_type]['default_html'] ), 'default_javascript' => trim( $_POST['chart_types'][$chart_type]['default_javascript'] ) ); } // strip slashes if any if ( !get_magic_quotes_gpc() ) { $settings = stripslashes_deep( $settings ); } // refresh built-in resources if ( ( $prev_location != $settings['location'] ) || ( isset( $_POST['refresh'] ) && '1' == $_POST['refresh'] ) ) { $settings['resources'] = amcharts_get_available_resources( $settings['location'], $settings['paths'] ); reset( $chart_type_libs ); foreach ( $chart_type_libs as $chart_type => $libs ) { if ( ! $settings['chart_types'][$chart_type]['custom_resources'] ) $settings['chart_types'][$chart_type]['default_resources'] = amcharts_get_resources( $libs, $settings['resources'] ); } } // save settings if ( 0 === count( $errors ) ) { update_option( 'amcharts_options', $settings ); $success = __( 'Settings were successfully saved!' ); } } ?>

0 ) : ?>

> >

Purchase a commercial version and help the development of this product as well as increase your karma points in the process.', 'amcharts' ); ?>

-

-

-

-

()

/

    $chart_type_name ) { ?>
$chart_type_name ) { // let the user edit resource list? $edit = $settings['chart_types'][$chart_type]['custom_resources'] ? true : false; ?>

%CHART% symbol for safe and unique chart ids and variables.' ); ?>

%CHART% symbol for safe and unique chart ids and variables.' ); ?>