<?php
/*
template.hack---generates site-wide page template.
Chris K. Young <cky@pobox.com>, October 2002.
$Id: template.hack,v 1.4 2002/11/02 12:24:51 cky Exp $
Copyright (c) 2002 Chris K. Young. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public Licence for more details.
You should have received a copy of the GNU General Public Licence
along with this program; if not, write to Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
class template {
var $title;
var $rcsid;
function template($title = 'The template gimmick') {
$this->set_title($title);
}
function doctype() {
return array('root' => 'html',
'pubid' => '-//W3C//DTD XHTML 1.0 Strict//EN',
'sysid' => 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
}
function set_title($title) {
$this->title = $title;
}
function set_rcsid($rcsid) {
$this->rcsid = $rcsid;
}
function print_header() {
$doctype = $this->doctype();
printf("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">\n", $doctype['root'],
$doctype['pubid'], $doctype['sysid']);
?>
<?php if (isset($this->rcsid)) printf("<!-- %s -->\n", $this->rcsid); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php print($this->title); ?></title>
<link rel="stylesheet" href="http://ckstyle.hedgee.com/" />
</head>
<body>
<?php
}
function validate_input() {
return false;
}
function process_input() {
return;
}
function print_form() {
?>
<p>The <samp>template</samp> gimmick generates the default header and footer used by <samp>gimmicks.hedgee.com</samp>. Other gimmicks can use this script if they wish to make a page that follows the same design.</p>
<?php
}
function print_footer() {
?>
</body>
</html>
<?php
}
}
class template_loose extends template {
function doctype() {
return array('root' => 'html',
'pubid' => '-//W3C//DTD XHTML 1.0 Transitional//EN',
'sysid' => 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd');
}
}
?>