here is the m_templates - and thanks for the speedy reply!
<?php
/*
Template Class
Handles all templating tasks - displaying templates, alerts & errors
*/
class Template
{
private $data;
private $alertTypes;
/*
Construtor
*/
function __construct() {}
/*
Functions
*/
function load($url)
{
include($url);
}
function redirect($url)
{
header("Location: $url");
}
/*
Get / Set Data
*/
function setData($name, $value)
{
$this->data[$name] = htmlentities($value, ENT_QUOTES);
}
function getData($name)
{
if (isset($this->data[$name]))
{
return $this->data[$name];
}
else
{
return '';
}
}
/*
Get / Set Alerts
*/
function setAlertTypes($types)
{
$this->alertTypes = $types;
}
function setAlert($value, $type = null)
{
if ($type == '') { $type = $this->alertTypes[0]; }
$_SESSION[$type][] = $value;
}
function getAlerts()
{
$data = '';
foreach($this->alertTypes as $alerts)
{
if (isset($_SESSION[$alerts]))
{
foreach($_SESSION[$alerts] as $value)
{
$data .= '<li class="'. $alerts .'">' . $value . '</li>';
}
unset($_SESSION[$alerts]);
}
}
return $data;
}
}