Ejemplo n.º 1
0
}
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" => "<u>P</u>oint your location on the map:", "ACCESSKEY" => "P", "STYLE" => "width: 600px; height: 400px", "Key" => $key, "Latitude" => 37.4419, "Longitude" => -122.1419, "ZoomLevel" => 3, "ZoomMarkers" => 1, "BoundsOffset" => 1.0, "MapType" => "Hybrid", "LatitudeLabel" => "<b>Latitude:</b>", "LatitudeStyle" => "background-color: #f1d9d9;", "LongitudeLabel" => "<b>Longitude:</b>", "LongitudeStyle" => "background-color: #f1d9d9", "Controls" => array("LargeMap" => array(), "Scale" => array(), "MapType" => array()), 'AdsManager' => array('Publisher' => $adsense_publisher, 'MaxAdsOnMap' => 1, 'Style' => 'adunit', 'Channel' => $adsense_channel), "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"), array("Latitude" => 38.58252615935333, "Longitude" => -121.48818969726562, "Information" => "Sacramento"), 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"), array("Latitude" => 32.71855479966606, "Longitude" => -117.16232299804688, "Information" => "San Diego"))));
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" => "<u>A</u>ddress:", "ACCESSKEY" => "A", "VALUE" => ""));
$form->AddInput(array("TYPE" => "select", "ID" => "country", "NAME" => "country", "VALUE" => "", "OPTIONS" => $country_codes, "LABEL" => "<u>C</u>ountry:", "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) {
Ejemplo n.º 2
0
<?php 
/*
 *  Set the debug level to 1 or more show alert messages
 *  when animation setup errors are detected
 */
$debug = 1;
/*
 *  Define an animation sequence to be started
 *  when the hide button is clicked
 */
$context = array('Name' => 'Hide form', 'Debug' => $debug, 'Effects' => array(array('Type' => 'CancelAnimation', 'Animation' => 'Show form'), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'Hiding...'), array('Type' => 'FadeOut', 'Element' => 'wholeform', 'Duration' => 0.5), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'Waiting 3 seconds...'), array('Type' => 'Wait', 'Duration' => 1.0), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'Waiting 2 seconds...'), array('Type' => 'Wait', 'Duration' => 1.0), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'Waiting 1 second...'), array('Type' => 'Wait', 'Duration' => 1.0), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'The form is hidden!')));
/*
 *  Connect the hide button with the animation input to start
 *  the animation defined aboved when the ONCLICK event is triggered
 */
$form->Connect('hide', 'animation', 'ONCLICK', 'AddAnimation', $context);
/*
 *  Define an animation sequence to be started
 *  when the show button is clicked
 */
$context = array('Name' => 'Show form', 'Debug' => $debug, 'Effects' => array(array('Type' => 'CancelAnimation', 'Animation' => 'Hide form'), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'Showing...'), array('Type' => 'FadeIn', 'Element' => 'wholeform', 'Duration' => 0.5), array('Type' => 'ReplaceContent', 'Element' => 'feedback', 'Content' => 'The form is visible!')));
$form->Connect('show', 'animation', 'ONCLICK', 'AddAnimation', $context);
$form->AddInputPart('animation');
$form->StartLayoutCapture();
require 'templates/form_animation.html.php';
$form->EndLayoutCapture();
$form->DisplayOutput();
?>
<hr />
</body>
</html>
Ejemplo n.º 3
0
require "forms.php";
require "form_linked_select.php";
$continents = array("" => "Select continent", "na" => "North America", "eu" => "Europe", "sa" => "South America", "as" => "Asia", "oc" => "Oceania");
$countries = array("" => array("" => "Select country"), "na" => array("" => "Select country", "us" => "United States", "ca" => "Canada"), "eu" => array("" => "Select country", "pt" => "Portugal", "de" => "Germany"), "sa" => array("" => "Select country", "br" => "Brazil", "ar" => "Argentina"), "as" => array("" => "Select country", "jp" => "Japan", "kr" => "Korea"), "oc" => array("" => "Select country", "au" => "Australia", "nz" => "New Zeland"));
$locations = array("" => array("" => "Select location"), "us" => array("" => "Select location", "ny" => "New York", "la" => "Los Angeles"), "ca" => array("" => "Select location", "to" => "Toronto", "mo" => "Montréal"), "pt" => array("" => "Select location", "li" => "Lisbon", "av" => "Aveiro"), "de" => array("" => "Select location", "fr" => "Frankfurt", "be" => "Berlin"), "br" => array("" => "Select location", "sa" => "São Paulo", "ri" => "Rio de Janeiro"), "ar" => array("" => "Select location", "bu" => "Buenos Aires", "ma" => "Mar del Plata"), "jp" => array("" => "Select location", "to" => "Tokio", "os" => "Osaka"), "kr" => array("" => "Select location", "se" => "Seoul", "yo" => "Yosu"), "au" => array("" => "Select location", "sy" => "Sydney", "me" => "Melbourne"), "nz" => array("" => "Select location", "we" => "Wellington", "au" => "Auckland"));
$form = new form_class();
$form->NAME = "location_form";
$form->METHOD = "POST";
$form->ACTION = "";
$form->debug = "error_log";
$form->AddInput(array("TYPE" => "select", "ID" => "continent", "NAME" => "continent", "LABEL" => "<u>C</u>ontinent", "ACCESSKEY" => "C", "VALUE" => "", "OPTIONS" => $continents, "ValidateAsNotEmpty" => 1, "ValidationErrorMessage" => "It was not specified a valid continent."));
$form->AddInput(array("TYPE" => "custom", "ID" => "country", "NAME" => "country", "LABEL" => "Coun<u>t</u>ry", "ACCESSKEY" => "t", "CustomClass" => "form_linked_select_class", "VALUE" => "", "Groups" => $countries, "LinkedInput" => "continent", "AutoWidthLimit" => 0, "AutoHeightLimit" => 0, "ValidateAsNotEmpty" => 1, "ValidationErrorMessage" => "It was not specified a valid country."));
$form->AddInput(array("TYPE" => "custom", "ID" => "location", "NAME" => "location", "LABEL" => "<u>L</u>ocation", "ACCESSKEY" => "L", "CustomClass" => "form_linked_select_class", "VALUE" => "", "Groups" => $locations, "LinkedInput" => "country", "AutoWidthLimit" => 0, "AutoHeightLimit" => 0, "ValidateAsNotEmpty" => 1, "ValidationErrorMessage" => "It was not specified a valid location."));
$form->AddInput(array("TYPE" => "submit", "VALUE" => ">", "NAME" => "update", "SubForm" => "update"));
$form->AddInput(array("TYPE" => "submit", "VALUE" => "Go", "NAME" => "doit"));
$form->Connect("location", "doit", "ONCHANGE", "Click", array());
/*
 * This code is necessary to handle the requests for serving the
 * dynamically generated lists of options for linked select inputs.
 */
$form->HandleEvent($processed);
if ($processed) {
    exit;
}
$form->LoadInputValues($form->WasSubmitted("doit"));
$verify = array();
if ($form->WasSubmitted("doit")) {
    if (($error_message = $form->Validate($verify)) == "") {
        $doit = 1;
    } else {
        $doit = 0;
Ejemplo n.º 4
0
/*
 * Create a form object.
 */
$form = new form_class();
$form->NAME = "subscription_form";
$form->METHOD = "POST";
$form->ACTION = "";
$form->debug = "error_log";
$form->AddInput(array("TYPE" => "text", "NAME" => "description", "ID" => "description", "LABEL" => "<u>D</u>escription", "ACCESSKEY" => "D", "ValidateAsNotEmpty" => 1, "ValidationErrorMessage" => "It was not specified a valid description."));
$form->AddInput(array("TYPE" => "file", "NAME" => "file", "ID" => "file", "LABEL" => "<u>F</u>ile", "ACCESSKEY" => "F", "ValidateAsNotEmpty" => 1, "ValidationErrorMessage" => "It was not specified a valid file."));
$form->AddInput(array("TYPE" => "submit", "NAME" => "doit", "ID" => "doit", "VALUE" => "Submit"));
$form->AddInput(array("TYPE" => "custom", "NAME" => "sender", "ID" => "sender", "CustomClass" => "form_ajax_submit_class", "FeedbackElement" => "feedback", "SubmitFeedback" => '<img src="indicator.gif" width="16" height="16" /> Submitting form ...', "TimeoutFeedback" => 'The communication with the server has timed out.', "Timeout" => 60, "ONTIMEOUT" => "", "DebugConsole" => "debug_console"));
/*
 *  Connect the doit submit button to the sender AJAX submit input
 */
$form->Connect("doit", "sender", "ONCLICK", "Submit", array());
/*
 *  Handle client side events on the server side.
 *  Do not output anything before these lines.
 */
$form->HandleEvent($processed);
if ($processed) {
    exit;
}
/*
 *  Did the AJAX submit post any notification message to the application?
 */
if ($form->GetNextMessage($message)) {
    /*
     *  Process and reply to notification messages
     */