All pastes #768449 Raw Edit

Untitled

public php v1 · immutable
·published 2007-11-10 16:59 UTC
rendered paste body
<?phpclass xhtml{	function div($div) {		$id = $div["id"];		$class = $div["class"];		$valeur = $div["valeur"];		if ($id == '' && $class =='')		$erreur = "Erreur, ID et CLASS ne peuvent être vide.[$div]";		$out = "\n".'<div';		if ($id != '') {      $out .= ' id="'.$id.'"'; }		if ($class != '') {   $out .= ' class="'.$class.'"'; }		$out .= '>'."\t";		if ($valeur != '') {			if (is_array($valeur)){									$out .= "\t".xhtml::div($valeur);					}else						$out .= "\n"."\t".$valeur."\n";}				$out .= '</div>'."\n";				if (isset($erreur))				return $erreur;				else				return $out;	}														function recup_div($div_array)	{			if (is_array($div_array))	{				foreach ($div_array as $div){					echo xhtml::div($div);}			}else	echo xhtml::div($div_array);		}									function page ($titre, $charset,$css,$div_array)					{						$doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"';						$doctype .='"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";						$html = '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";						$head = '<head>'."\n";						$head .='<meta http-equiv="Content-Type" content="text/html; charset='.$charset.'" />'."\n";						$head .='<title>'.$titre.'</title>'."\n";						$head .='<link rel="stylesheet" href="css/'.$css.'.css" type="text/css" media="screen" />'."\n";						$head .= '</head>'."\n".'<body>'."\n";						$foot = '</body>'."\n".'</html>';						echo $doctype;						echo $html;						echo $head;						foreach ($div_array as $div_array2)	{	echo xhtml::recup_div($div_array2); }						echo $foot;						} } ?>