TRUE, "ee_enable_streetview" => TRUE, "ee_enable_widget" => FALSE, "fe_interval" => 60, // "gm_api_url" => "http://maps.google.com/maps?file=api&v=2.x", "gm_api_key" => "", "gm_enable_map" => TRUE, "gm_use_static_map" => TRUE, "gm_use_dynamic_map" => TRUE, "gm_map_width" => 200, "gm_map_height" => 200, "gm_map_zoom" => 10, "gm_enable_streetview" => TRUE, // "ig_api_url" => "http://www.google.com/ig/api", "ig_enable_weather" => TRUE, "ig_enable_weather_icon" => TRUE, "ig_weather_icon_url" => "http://www.google.com/ig", "ig_weather_icon_height" => 40, "ig_weather_icon_width" => 40, "widget_title" => "Eagle Eye" ); add_option("ee_options", $ee_options, '', 'yes'); } /* * Function to execute when plugin is removed */ register_deactivation_hook( __FILE__, 'eagle_eye_deactivate' ); function eagle_eye_deactivate() { delete_option("ee_options"); } /* * Add Eagle Eye to Plugin menu */ function eagle_eye_add_menu() { if (function_exists('add_options_page')) { add_submenu_page('plugins.php', 'Eagle Eye Options', 'Eagle Eye', 8, basename(__FILE__), 'eagle_eye_options_page'); } } add_action('admin_menu', 'eagle_eye_add_menu'); function eagle_eye_options_page() { include dirname(__FILE__) . "/fe_config.php"; $ee_options = get_option("ee_options"); if(@$_GET['f'] == 'callback') { /* * Return from request for Fire Eagle authorization */ if (@$_SESSION['auth_state'] != "start") { echo "Out of sequence."; } if ($_GET['oauth_token'] != $_SESSION['request_token']) { echo "Token mismatch."; } $fe = new FireEagle( $fe_key, $fe_secret, $_SESSION['request_token'], $_SESSION['request_secret']); try { $tok = $fe->getAccessToken(); } catch (FireEagleException $e) { echo $e->getMessage(); } if (isset($tok['oauth_token']) && is_string($tok['oauth_token']) && isset($tok['oauth_token_secret']) && is_string($tok['oauth_token_secret'])) { $ee_options['fe_access_token'] = $tok['oauth_token']; $ee_options['fe_access_secret'] = $tok['oauth_token_secret']; $ee_options['fe_auth_state'] = 'done'; $_SESSION['fe_access_token'] = $tok['oauth_token']; $_SESSION['fe_access_secret'] = $tok['oauth_token_secret']; $_SESSION['fe_auth_state'] = 'done'; $ee_options['ee_enable_widget'] = 1; $ee_options['fe_last_updated'] = time(); update_option('ee_options', $ee_options); } } if ($_POST['ee_send']) { /* * Save form variables */ $ee_options['fe_interval'] = $_POST['ee_fe_interval']; // $ee_options['gm_api_url'] = $_POST['ee_gm_api_url']; $ee_options['gm_api_key'] = $_POST['ee_gm_api_key']; $ee_options['gm_enable_map'] = $_POST['ee_gm_enable_map']; $ee_options['gm_enable_streetview'] = $_POST['ee_gm_enable_streetview']; $ee_options['gm_use_static_map'] = $_POST['ee_gm_use_static_map']; $ee_options['gm_use_dynamic_map'] = $_POST['ee_gm_use_dynamic_map']; $ee_options['gm_map_width'] = $_POST['ee_gm_map_width']; $ee_options['gm_map_height'] = $_POST['ee_gm_map_height']; $ee_options['gm_map_zoom'] = $_POST['ee_gm_map_zoom']; // $ee_options['ig_api_url'] = $_POST['ee_ig_api_url']; $ee_options['ig_enable_weather'] = $_POST['ee_ig_enable_weather']; $ee_options['ig_enable_weather_icon'] = $_POST['ee_ig_enable_weather_icon']; $ee_options['ig_weather_icon_url'] = $_POST['ee_ig_weather_icon_url']; $ee_options['ig_weather_icon_height'] = $_POST['ee_ig_weather_icon_height']; $ee_options['ig_weather_icon_width'] = $_POST['ee_ig_weather_icon_width']; $ee_options['widget_title'] = $_POST['ee_widget_title']; update_option('ee_options', $ee_options); print '
Settings saved.
|
|
|