Location: PHPKode > scripts > PHP 4 Applications > php-4-applications/myapp.php
<?php
	require_once("p4a_constants.php");
	require_once("p4a.php");
	require_once("myapp_classes.php");

class MyApp extends p4a_Application
{
	var $topmenu;
	var $panel1;
	var $panel2;

	function onStart()
	{
		$this->topmenu = new TopMenu( "topmenu", $this);
		$this->panel1 = new Panel1( "panel01", $this, 1);
		$this->panel2 = new Panel2( "panel02", $this, 0);
	}

	function event_handler( $_event)
	{
		switch( substr($_event['event'], 0, 7))
		{
			case "topmenu":
				$answer .= $this->topmenu->event_handler( $_event, $this);
				break;
			case "panel01":
				$answer .= $this->panel1->event_handler( $_event, $this);
				break;
			case "panel02":
				$answer .= $this->panel2->event_handler( $_event, $this);
				break;
			default:
				$answer .= $this->flush(1);
				break;
		}

		return $answer;
	}
}

?>
Return current item: PHP 4 Applications