messages = array(); $this->fields = array( 'previous' => __("Previous [Left arrow]", 'keyboard-navigation'), 'next' => __("Next [Right arrow]", 'keyboard-navigation'), 'first' => __("First [Shift-Left arrow]", 'keyboard-navigation'), 'last' => __("Last [Shift-Right arrow]", 'keyboard-navigation'), ); if (isset($_POST['kbnav'])) { if (is_array($_POST['kbnav'])) { if (isset($_POST['kbnav']['_nonce'])) { if (wp_verify_nonce($_POST['kbnav']['_nonce'], 'keyboard-navigation')) { if (isset($_POST['kbnav']['module'])) { $method = "handle_update_" . $_POST['kbnav']['module']; if (method_exists($this, $method)) { $this->{$method}($_POST['kbnav']); } } } } } } } function handle_update_options($info) { $options = array(); foreach (array('selectors', 'highlight') as $field) { if (isset($info[$field])) { $options[$field] = $info[$field]; } } update_option('keyboard-navigation-options', $options); $this->messages[] = __('Options updated.', 'keyboard-navigation'); } function KeyboardNavigation() {} function wp_footer() { $plugin_dir_url = plugin_dir_url(__FILE__); $options = get_option('keyboard-navigation-options'); $nonce = wp_create_nonce('keyboard-navigation'); $options = get_option('keyboard-navigation-options'); if (!is_array($options)) { $options = array(); } ?> '; } } function link_editor() { $plugin_dir_url = plugin_dir_url(__FILE__); $nonce = wp_create_nonce('keyboard-navigation'); $options = get_option('keyboard-navigation-options'); if (!is_array($options)) { $options = array(); } $plugin_data = get_plugin_data(__FILE__); include(dirname(__FILE__) . '/admin.inc'); } } $keyboard_navigation = new KeyboardNavigation(); add_action('init', array(&$keyboard_navigation, 'init')); ?>