'4', 'location' => 'remote', 'relative' => '0', 'own' => '0', 'paths' => '', 'wrap' => '1', 'resources' => '', //'resources' => amcharts_get_available_resources(), // moving this on on plugin activation or update so that resource list // is not requested every time 'custom_resources' => '', 'chart_types' => array() ); if ( $load_resources ) { $settings['resources'] = amcharts_get_available_resources( $settings['location'], $settings['paths'], $settings['relative'], $settings['version'] ); } $chart_libs = amcharts_get_chart_type_libs( $settings['version'] ); foreach ( $chart_libs as $chart_type => $libs ) { $settings['chart_types'][$chart_type] = array( 'default_resources' => '', //'default_resources' => amcharts_get_resources( $libs, $settings['resources'] ), // moving this on on plugin activation or update so that resource list // is not requested every time 'custom_resources' => 0, 'default_html' => amcharts_get_default( $chart_type, 'html', $settings['version'] ), 'default_javascript' => amcharts_get_default( $chart_type, 'javascript', $settings['version'] ) ); if ( $load_resources ) { $settings['chart_types'][$chart_type]['default_resources'] = amcharts_get_resources( $libs, $settings['resources'] ); } } 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' ); // load current settings $settings = get_option( 'amcharts_options', amcharts_get_defaults() ); // handle situation where version is not (yet) set if ( !isset( $settings['version'] ) ) { $settings['version'] = '3'; } // get chart type settings $chart_types = amcharts_get_chart_types( $settings['version'] ); $chart_type_libs = amcharts_get_chart_type_libs( $settings['version'] ); // 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['relative'] = isset( $_POST['relative'] ) && '1' == $_POST['relative'] ? '1' : '0'; if ( $settings['version'] == '3' ) { $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 ); } // handle version switch if (isset( $_POST['switch_version'] ) && $_POST['target_version'] != $settings['version']) { $settings['version'] = $_POST['target_version'] == '3' ? '3' : '4'; // load types again (version changed) $chart_types = amcharts_get_chart_types( $settings['version'] ); $chart_type_libs = amcharts_get_chart_type_libs( $settings['version'] ); // need to load available resources, too $settings['resources'] = amcharts_get_available_resources( $settings['location'], $settings['paths'], $settings['relative'], $settings['version'] ); // set up defaults as well foreach ( $chart_type_libs as $chart_type => $libs ) { $settings['chart_types'][$chart_type] = array( 'default_resources' => amcharts_get_resources( $libs, $settings['resources'] ), // moving this on on plugin activation or update so that resource list // is not requested every time 'custom_resources' => 0, 'default_html' => amcharts_get_default( $chart_type, 'html', $settings['version'] ), 'default_javascript' => amcharts_get_default( $chart_type, 'javascript', $settings['version'] ) ); if ( $load_resources ) { $settings['chart_types'][$chart_type]['default_resources'] = amcharts_get_resources( $libs, $settings['resources'] ); } } } // 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'], $settings['relative'], $settings['version'] ); 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 ) : ?>

amCharts

 

-

-

-

-

> > >

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.', 'amcharts' ); ?>

$CHART$ symbol for safe and unique chart ids and variables.', 'amcharts' ); ?>