3 * This file provides output functions
4 * @author Nick Korbel <lqqkout13@users.sourceforge.net>
6 * @package phpScheduleIt
8 * Copyright (C) 2003 - 2005 phpScheduleIt
9 * License: GPL, see LICENSE
12 * Base directory of application
14 @define
('BASE_DIR', dirname(__FILE__
) . '/..');
18 include_once('Auth.class.php');
21 * Provides functions for outputting template HTML
29 * Set the page's title
30 * @param string $title title of page
31 * @param int $depth depth of the current page relative to phpScheduleIt root
33 function Template($title = '', $depth = 0) {
36 $this->title
= (!empty($title)) ?
$title : $conf['ui']['welcome'];
37 $this->dir_path
= str_repeat('../', $depth);
38 $this->link
= CmnFns
::getNewLink();
39 //Auth::Auth(); // Starts session
43 * Print all XHTML headers
44 * This function prints the HTML header code, CSS link, and JavaScript link
46 * DOCTYPE is XHTML 1.0 Transitional
49 function printHTMLHeader() {
55 $path = $this->dir_path
;
56 echo "<?xml version=\"1.0\" encoding=\"$charset\"?" . ">\n";
58 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
59 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
60 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?=$languages[$lang][2]?>" lang
="<?=$languages[$lang][2]?>">
65 <meta http
-equiv
="Content-Type" content
="text/html; charset=<?=$charset?>" />
66 <link rel
="shortcut icon" href
="img/favicon.ico" type
="image/x-icon" />
67 <script language
="JavaScript" type
="text/javascript" src
="<?=$path?>functions.js"></script
>
68 <!--<link href
="<?=$path?>css.css" rel
="stylesheet" type
="text/css" />-->
69 <style type
="text/css">
70 @import
url(<?
=$path?
>css
.css
);
79 * Print welcome header message
80 * This function prints out a table welcoming
81 * the user. It prints links to My Control Panel,
82 * Log Out, Help, and Email Admin.
83 * If the user is the admin, an admin banner will
87 function printWelcome() {
90 // Print out logoImage if it exists
91 echo (!empty($conf['ui']['logoImage']))
92 ?
'<div align="left"><img src="' . $conf['ui']['logoImage'] . '" alt="logo" vspace="5" /></div>'
95 <table width
="100%" border
="0" cellspacing
="0" cellpadding
="5" class="mainBorder">
97 <td
class="mainBkgrdClr">
98 <h4
class="welcomeBack">
100 translate('Welcome Back', array($_SESSION['sessionName'], 1));
101 // Notify if the person logged in is admin
102 echo (Auth
::isMailAdmin() ?
' (' . translate('Administrator') . ')' : '');
106 <?
$this->link
->doLink($this->dir_path
. 'index.php?logout=true', translate('Log Out')) ?
>
108 <?
$this->link
->doLink($this->dir_path
. 'summary.php', translate('My Control Panel')) ?
>
111 <td
class="mainBkgrdClr" valign
="top">
114 <?
= translate_date('header', mktime());?
>
117 <?
$this->link
->doLink('javascript: help();', translate('Help')) ?
>
128 * Start main HTML table
131 function startMain() {
134 <table width
="100%" border
="0" cellspacing
="0" cellpadding
="10" style
="border: solid #CCCCCC 1px;">
136 <td bgcolor
="#FAFAFA">
142 * End main HTML table
156 * This function prints out a tech email
157 * link and closes off HTML page
160 function printHTMLFooter() {
163 <p align
="center"><a href
="http://www.mailzu.net"><?
=$conf['app']['title']?
> v
<?
=$conf['app']['version']?
></a
></p
>
170 * Sets the link class variable to reference a new Link object
173 function set_link() {
174 $this->link
= CmnFns
::getNewLink();
178 * Returns the link object
180 * @return link object for this class
182 function get_link() {
187 * Sets a new title for the template page
188 * @param string $title title of page
190 function set_title($title) {
191 $this->title
= $title;