<?php
/* example index.php in Treematk 0.3 (third released version)
 * by Yushin Washio
 *
 * licensed under GNU LGPL
 */
@include('treematk.php');
$exampletree =new tree;
$stree =array_key_exists('tree',$_GET)? $_GET['tree']: 'tree.matk,ma.tk';
$exampletree->generator($stree);
$trht=$exampletree->tree_html();

$html_head = '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <title>TITLE</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <style type="text/css" media="all">@import "treematk.css";.tree{width:100%;}</style>
</head>';

echo(str_replace('TITLE',$stree.' - Treematk',$html_head)."\n<body>\n<h1>Tree $stree</h1>\n<form action=\"embed.php\" method=\"get\"><p>\n  <input type=\"text\" name=\"tree\" value=\"$stree\" style=\"min-width:60%\"/>\n  <input type=\"submit\" value=\"draw!\"/>\n</p></form>\n$trht");
?>
  <p>This is the demonstration site of the opensource project Treematk, hosted by <a href="http://projects.tuxfamily.org/group.pl?name=treematk">Tuxfamily</a>.</p>
</body>
