Location: PHPKode > projects > PHP Ajax Forms Framework > pajff/pajff_header.php
<?php
/**
* PAjFF page header
* 
* <p>The top of PAjFF page- x button, div element,...</p>
* 
* {@link http://sourceforge.net/projects/pajff Project home}
* 
* @package PAjFF
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Atanas Markov hide@address.com
* @version 0.0.2
* @copyright 2006 by Atanas Markov
*
* @subpackage pajff_header
**/

/**
 * @global string $pajffcharsetlong
 */
global $pajffcharsetlong;
/**
 * @global pajff_session $pajffmainsession
 */
global $pajffmainsession;
/**
 * @global xajax $xajax
 */
global $xajax;
/*
*	Fill $result with the header.
*/
$result = "
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html";
if ($pajffcharsetlong){ $result .= "; charset=$pajffcharsetlong\""; }
$result .=">
<title>";

if ($app->title) {
	$result .= $app->title;
} else {
	$result .= "PAjFF application";
}

$result .= "</title>

<!-- scripts here -->
";
global $pajffxajaxpath;

$result .= $xajax->getJavascript(substr($pajffxajaxpath,1,1000)).
		"
		<script>
		var pajffform=\"\";
		var pajffevent=\"\";
		var pajffsesid=\"\";
		
		function ajaxSubmit(){
		//	alert('here i am');
			xajax_pajffHandleEvent(\"".
				$pajffmainsession->sessionID().
                "\",pajffsesid,pajffevent,xajax.getFormValues(pajffform));
            return false;
			
		}
		
		function doajax(event,form,sesid, params) {
				/*
				  event is the element name
				  form is the form name to get data from
				  sesid is the form session id
				*/
				xajax_pajffHandleEvent(\"".
				$pajffmainsession->sessionID().
                "\",sesid,event,params);
                return false;
        }
        
        function submitClick(event,form, sesid){
       //     alert('btnclick');
        	pajffform= form;
        	pajffevent= event;
        	pajffsesid= sesid;
        }
        
        function doClick(event,form, sesid, container, value, pass){
       //     alert('btnclick');
        	var passme= value;
        	if (container!=\"\"){
        		passme= document.getElementById(container).value;
        	}
        	if (pass){
        		return xajax_pajffHandleEvent(\"".
					$pajffmainsession->sessionID().
                	"\",sesid,event,passme,xajax.getFormValues(form));
        	} else {
        		return xajax_pajffHandleEvent(\"".
					$pajffmainsession->sessionID().
                	"\",sesid,event,passme);
        	}
            return false;
        }
        </script>";

if ($app->appname&&file_exists(pajffRealPath().'../java/'.$app->appname.'.php')) {
	include pajffPath().'../java/'.$app->appname.'.php';
}

global $pajffmainsession;

$result .= "
<script language=\"javascript\">window.onerror = doNothing;</script>
</head>
<body>
<div name=\"".$pajffmainsession->htmlelement."\" id=\"".$pajffmainsession->htmlelement."\">";
?>
Return current item: PHP Ajax Forms Framework