2008-12-10 14:33:43 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This file provides output functions
|
|
|
|
* @author Nick Korbel <lqqkout13@users.sourceforge.net>
|
|
|
|
* @version 10-21-04
|
|
|
|
* @package phpScheduleIt
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 - 2005 phpScheduleIt
|
|
|
|
* License: GPL, see LICENSE
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Base directory of application
|
|
|
|
*/
|
|
|
|
@define('BASE_DIR', dirname(__FILE__) . '/..');
|
|
|
|
/**
|
|
|
|
* Include Auth class
|
|
|
|
*/
|
|
|
|
include_once('Auth.class.php');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides functions for outputting template HTML
|
|
|
|
*/
|
|
|
|
class Template {
|
|
|
|
var $title;
|
|
|
|
var $link;
|
|
|
|
var $dir_path;
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Set the page's title
|
|
|
|
* @param string $title title of page
|
|
|
|
* @param int $depth depth of the current page relative to phpScheduleIt root
|
|
|
|
*/
|
|
|
|
function Template($title = '', $depth = 0) {
|
|
|
|
global $conf;
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
$this->title = (!empty($title)) ? $title : $conf['ui']['welcome'];
|
|
|
|
$this->dir_path = str_repeat('../', $depth);
|
|
|
|
$this->link = CmnFns::getNewLink();
|
|
|
|
//Auth::Auth(); // Starts session
|
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Print all XHTML headers
|
|
|
|
* This function prints the HTML header code, CSS link, and JavaScript link
|
|
|
|
*
|
|
|
|
* DOCTYPE is XHTML 1.0 Transitional
|
|
|
|
* @param none
|
|
|
|
*/
|
|
|
|
function printHTMLHeader() {
|
|
|
|
global $conf;
|
|
|
|
global $languages;
|
|
|
|
global $lang;
|
|
|
|
global $charset;
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
$path = $this->dir_path;
|
|
|
|
echo "<?xml version=\"1.0\" encoding=\"$charset\"?" . ">\n";
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2016-02-04 17:03:27 +01:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $languages[$lang][2]?>" lang="<?php echo $languages[$lang][2]?>">
|
2008-12-10 14:33:43 +01:00
|
|
|
<head>
|
|
|
|
<title>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php echo $this->title?>
|
2008-12-10 14:33:43 +01:00
|
|
|
</title>
|
2016-02-04 17:03:27 +01:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset?>" />
|
2008-12-10 14:33:43 +01:00
|
|
|
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
|
2016-02-04 17:03:27 +01:00
|
|
|
<script language="JavaScript" type="text/javascript" src="<?php echo $path?>functions.js"></script>
|
|
|
|
<!--<link href="<?php echo $path?>css.css" rel="stylesheet" type="text/css" />-->
|
2008-12-10 14:33:43 +01:00
|
|
|
<style type="text/css">
|
2016-02-04 17:03:27 +01:00
|
|
|
@import url(<?php echo $path?>css.css);
|
2008-12-10 14:33:43 +01:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php
|
2008-12-10 14:33:43 +01:00
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Print welcome header message
|
|
|
|
* This function prints out a table welcoming
|
|
|
|
* the user. It prints links to My Control Panel,
|
|
|
|
* Log Out, Help, and Email Admin.
|
|
|
|
* If the user is the admin, an admin banner will
|
|
|
|
* show up
|
|
|
|
* @global $conf
|
|
|
|
*/
|
|
|
|
function printWelcome() {
|
|
|
|
global $conf;
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
// Print out logoImage if it exists
|
|
|
|
echo (!empty($conf['ui']['logoImage']))
|
|
|
|
? '<div align="left"><img src="' . $conf['ui']['logoImage'] . '" alt="logo" vspace="5" /></div>'
|
|
|
|
: '';
|
|
|
|
?>
|
|
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="mainBorder">
|
|
|
|
<tr>
|
|
|
|
<td class="mainBkgrdClr">
|
|
|
|
<h4 class="welcomeBack">
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php
|
|
|
|
echo translate('Welcome Back', array($_SESSION['sessionName'], 1));
|
2008-12-10 14:33:43 +01:00
|
|
|
// Notify if the person logged in is admin
|
|
|
|
echo (Auth::isMailAdmin() ? ' (' . translate('Administrator') . ')' : '');
|
|
|
|
?>
|
|
|
|
</h4>
|
|
|
|
<!--<p>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php $this->link->doLink($this->dir_path . 'index.php?logout=true', translate('Log Out')) ?>
|
2008-12-10 14:33:43 +01:00
|
|
|
|
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php $this->link->doLink($this->dir_path . 'summary.php', translate('My Control Panel')) ?>
|
2008-12-10 14:33:43 +01:00
|
|
|
</p>-->
|
|
|
|
</td>
|
|
|
|
<td class="mainBkgrdClr" valign="top">
|
|
|
|
<div align="right">
|
|
|
|
<p>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php echo translate_date('header', mktime());?>
|
2008-12-10 14:33:43 +01:00
|
|
|
</p>
|
|
|
|
<!--<p>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php $this->link->doLink('javascript: help();', translate('Help')) ?>
|
2008-12-10 14:33:43 +01:00
|
|
|
</p>-->
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php
|
2008-12-10 14:33:43 +01:00
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Start main HTML table
|
|
|
|
* @param none
|
|
|
|
*/
|
|
|
|
function startMain() {
|
|
|
|
?>
|
|
|
|
<p> </p>
|
|
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="10" style="border: solid #CCCCCC 1px;">
|
|
|
|
<tr>
|
|
|
|
<td bgcolor="#FAFAFA">
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php
|
2008-12-10 14:33:43 +01:00
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* End main HTML table
|
|
|
|
* @param none
|
|
|
|
*/
|
|
|
|
function endMain() {
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php
|
2008-12-10 14:33:43 +01:00
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Print HTML footer
|
|
|
|
* This function prints out a tech email
|
|
|
|
* link and closes off HTML page
|
|
|
|
* @global $conf
|
|
|
|
*/
|
|
|
|
function printHTMLFooter() {
|
|
|
|
global $conf;
|
|
|
|
?>
|
2016-02-04 17:03:27 +01:00
|
|
|
<p align="center"><a href="http://www.mailzu.net"><?php echo $conf['app']['title']?> v<?php $conf['app']['version']?></a></p>
|
2008-12-10 14:33:43 +01:00
|
|
|
</body>
|
|
|
|
</html>
|
2016-02-04 17:03:27 +01:00
|
|
|
<?php
|
2008-12-10 14:33:43 +01:00
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Sets the link class variable to reference a new Link object
|
|
|
|
* @param none
|
|
|
|
*/
|
|
|
|
function set_link() {
|
|
|
|
$this->link = CmnFns::getNewLink();
|
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Returns the link object
|
|
|
|
* @param none
|
2016-02-04 17:26:07 +01:00
|
|
|
* @return link object for this class
|
2008-12-10 14:33:43 +01:00
|
|
|
*/
|
|
|
|
function get_link() {
|
|
|
|
return $this->link;
|
|
|
|
}
|
2016-02-04 17:26:07 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
/**
|
|
|
|
* Sets a new title for the template page
|
|
|
|
* @param string $title title of page
|
|
|
|
*/
|
|
|
|
function set_title($title) {
|
|
|
|
$this->title = $title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|