__( 'User Agreement', 'wp_awld_js' ), 'type' => 'title', 'desc' => '', 'id' => 'settings-terms' ), array( 'name' => __( 'Terms of use', 'wp_awld_js' ), 'desc' => __( 'I agree to the terms of use.', 'wp_awld_js' ), 'id' => 'wp_awld_js_i_accept', 'css' => 'min-width:300px;', 'std' => 'yes', 'type' => 'checkbox' ), array( 'type' => 'sectionend', 'id' => 'settings-terms'), array( 'name' => __( 'General Settings', 'wp_awld_js' ), 'type' => 'title', 'desc' => '', 'id' => 'settings-general' ), array( 'name' => __( 'Scope', 'wp_awld_js' ), 'desc' => __( 'Restricts the work of the awld.js library to a part of the document.', 'wp_awld_js' ), 'id' => 'wp_awld_js_scope', 'css' => 'min-width:160px;', 'std' => 'post', 'type' => 'select', 'options' => array( 'post' => __( 'Post', 'wp_awld_js' ), 'body' => __( 'Body', 'wp_awld_js' ), 'manual' => __( 'Manual', 'wp_awld_js' ), ) ), array( 'type' => 'sectionend', 'id' => 'settings-general'), array( 'name' => __( 'Widget Settings', 'wp_awld_js' ), 'type' => 'title', 'desc' => '', 'id' => 'settings-widget' ), array( 'name' => __( 'Implementation', 'wp_awld_js' ), 'desc' => __( 'Please choose how would you like to implement the widget.', 'wp_awld_js' ), 'id' => 'wp_awld_js_widget_implement', 'css' => 'min-width:160px;', 'std' => 'none', 'type' => 'select', 'options' => array( 'none' => __( 'No Widget', 'wp_awld_js' ), 'prepend' => __( 'Prepend to post content', 'wp_awld_js' ), 'append' => __( 'Append to post content', 'wp_awld_js' ), 'widget' => __( 'WordPress widget', 'wp_awld_js' ), 'shortcode' => __( 'Shortcode', 'wp_awld_js' ), 'tag' => __( 'Template tag', 'wp_awld_js' ) ) ), array( 'type' => 'sectionend', 'id' => 'settings-widget'), array( 'name' => __( 'Editor Settings', 'wp_awld_js' ), 'type' => 'title', 'desc' => '', 'id' => 'settings-editor' ), array( 'name' => __( 'Buttons', 'wp_awld_js' ), 'desc' => __( 'Enable tinyMCE button in the visual editor.', 'wp_awld_js' ), 'id' => 'wp_awld_js_button', 'css' => 'min-width:300px;', 'std' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start' ), array( 'name' => __( 'Buttons', 'wp_awld_js' ), 'desc' => __( 'Enable quicktags in the HTML editor.', 'wp_awld_js' ), 'id' => 'wp_awld_js_quicktags', 'css' => 'min-width:300px;', 'std' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end' ), array( 'type' => 'sectionend', 'id' => 'settings-editor'), )); // End of settings array /** * Options page * * Handles the display of the options page. */ if ( ! function_exists( 'wp_awld_js_settings' ) ) { function wp_awld_js_settings() { global $wp_awld_js, $wp_awld_js_settings; $current_tab = ( empty( $_GET['tab'] ) ) ? 'about' : urldecode( $_GET['tab'] ); if ( ! empty( $_POST ) ) { if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'wp-awld-js-settings' ) ) die( __( 'Something went wrong. Please refresh the page and retry.', 'wp_awld_js' ) ); switch ( $current_tab ) { case "about" : case "usage" : case "examples" : break; case "settings" : wp_awld_js_update_options( $wp_awld_js_settings[$current_tab] ); break; } do_action( 'wp_awld_js_update_options' ); do_action( 'wp_awld_js_update_options_' . $current_tab ); $redirect = add_query_arg( 'saved', 'true' ); //wp_safe_redirect( $redirect ); echo ""; exit; } if ( ! empty( $_GET['saved'] ) ) { echo '
' . __( 'Your settings have been saved.', 'wp_awld_js' ) . '
' . sprintf( __( 'Hello, %s. Ancient World Linked Data for WordPress has been successfully installed!', 'wp_awld_js' ), $current_user->display_name ) . '