NAME="maps_form"; $form->METHOD="POST"; $form->ACTION=""; $form->debug="trigger_error"; /* * This is just for testing purposes */ if(defined('GOOGLE_MAPS_KEY')) $key=GOOGLE_MAPS_KEY; if(defined('ADSENSE_PUBLISHER')) $adsense_publisher=ADSENSE_PUBLISHER; if(defined('ADSENSE_CHANNEL')) $adsense_publisher=ADSENSE_CHANNEL; $error=$form->AddInput(array( "TYPE"=>"custom", "CustomClass"=>"form_map_location_class", "ID"=>"map", "LABEL"=>"Point your location on the map:", "ACCESSKEY"=>"P", "STYLE"=>"width: 600px; height: 400px", /* "CLASS"=>"some CSS class", */ /* * Go to the Google Maps API site to obtain a free API key for your * domain: http://www.google.com/apis/maps/signup.html */ "Key"=>$key, "Latitude"=>37.4419, "Longitude"=>-122.1419, "ZoomLevel"=>3, /* "ZoomBounds"=>array( 32, -123, 39, -117 ), */ "ZoomMarkers"=>1, "BoundsOffset"=>1.0, "MapType"=>"Hybrid", "LatitudeLabel"=>"Latitude:", "LatitudeStyle"=>"background-color: #f1d9d9;", /* "LatitudeClass"=>"some CSS class", */ "LongitudeLabel"=>"Longitude:", "LongitudeStyle"=>"background-color: #f1d9d9", /* "LatitudeClass"=>"some CSS class", */ "Controls"=>array( /* "SmallMap"=>array(), */ "LargeMap"=>array(), /* "SmallZoom"=>array(), */ "Scale"=>array(), "MapType"=>array(), /* "OverviewMap"=>array(), */ ), 'AdsManager'=>array( 'Publisher'=>$adsense_publisher, 'MaxAdsOnMap'=>1, 'Style'=>'adunit', 'Channel'=>$adsense_channel ), /* "Accessible"=>1, "HideMarker"=>0, */ "Clusters"=>array( 'common'=>array( 'Manager'=>'MarkerClusterer', 'Path'=>'markerclusterer.js' ) ), "Markers"=>array( array( "Latitude"=>37.78156937014928, "Longitude"=>-122.42340087890625, "Information"=>"San Francisco", "Link"=>"http://www.ci.sf.ca.us/", "Target"=>"_blank", "Title"=> "Click here to go to the official San Francisco government site on a new window", 'Cluster'=>'common' ), array( "Latitude"=>38.58252615935333, "Longitude"=>-121.48818969726562, "Information"=>"Sacramento", 'Cluster'=>'common' ), array( "Latitude"=>34.05265942137599, "Longitude"=>-118.2403564453125, "Information"=>"Los Angeles", "Link"=>"http://www.ci.la.ca.us/", "Title"=> "Click here to go to the official Los Angeles government site on this window", 'Cluster'=>'common' ), array( "Latitude"=>32.71855479966606, "Longitude"=>-117.16232299804688, "Information"=>"San Diego", 'Cluster'=>'common' ), ) )); if(strlen($error)) die("Error: ".$error); $form->AddInput(array( "TYPE"=>"submit", "VALUE"=>"Submit", "NAME"=>"doit" )); $form->AddInput(array( "TYPE"=>"textarea", "ID"=>"address", "NAME"=>"address", "COLS"=>60, "ROWS"=>3, "LABEL"=>"Address:", "ACCESSKEY"=>"A", "VALUE"=>"", )); $form->AddInput(array( "TYPE"=>"select", "ID"=>"country", "NAME"=>"country", "VALUE"=>"", "OPTIONS"=>$country_codes, "LABEL"=>"Country:", "ACCESSKEY"=>"C", )); $form->AddInput(array( "TYPE"=>"button", "ID"=>"locate_address", "NAME"=>"locate_address", "VALUE"=>"Locate address", )); $form->Connect("locate_address", "map", "ONCLICK", "LocateAddress", array( "Address"=>"address", "Country"=>"country", "CountryValue"=>"SelectedOption" )); $form->AddInput(array( "TYPE"=>"submit", "ID"=>"refresh", "VALUE"=>"Refresh", "SubForm"=>"refresh" )); $form->LoadInputValues($form->WasSubmitted("doit")); $verify=array(); if($form->WasSubmitted("doit")) { if(($error_message=$form->Validate($verify))=="") $doit=1; else { $doit=0; $error_message=HtmlEntities($error_message); } } else { $error_message=""; $doit=0; } if(!$doit) { if(strlen($error_message)) { Reset($verify); $focus=Key($verify); } else $focus='map'; $form->ConnectFormToInput($focus, 'ONLOAD', 'Focus', array()); } $onload = HtmlSpecialChars($form->PageLoad()); $onunload = HtmlSpecialChars($form->PageUnload()); ?> Test for Manuel Lemos' PHP form class using the map location plug-in input PageHead(); ?>

Test for Manuel Lemos' PHP form class using the map location plug-in input


GetInputProperty("map", "Latitude", $latitude); $form->GetInputProperty("map", "Longitude", $longitude); echo '

The location latitude is ', $latitude, ' and the longitude is ', $longitude, '.

'; } else { $form->StartLayoutCapture(); $title="Form map location plug-in test"; $body_template="form_map_location_body.html.php"; include("templates/form_frame.html.php"); $form->EndLayoutCapture(); $form->DisplayOutput(); } ?>