3 * This file provides common output functions thar are used by other templates
4 * No data manipulation is done in this file
6 * Following functions were borrowed from phpScheduleIt Project:
10 * - getShowHideHeaders()
11 * - startQuickLinksCol()
12 * - startDataDisplayCol()
13 * - endDataDisplayCol()
14 * @author Nick Korbel <lqqkout13@users.sourceforge.net>
16 * @author David Poole <David.Poole@fccc.edu>
19 * Copyright (C) 2003 - 2005 phpScheduleIt
21 * New functions added for MailZu
22 * @author Samuel Tran <stran2005@users.sourceforge.net>
23 * @author Brian Wong <bwsource@users.sourceforge.net>
24 * @author Nicolas Peyrussie <peyrouz@users.sourceforge.net>
25 * @author Jeremy Fowler <jfowler06@users.sourceforge.net>
26 * Copyright (C) 2005 - 2007 MailZu
27 * License: GPL, see LICENSE
31 $link = CmnFns
::getNewLink();
34 * Print out a table of links for user or administrator
35 * This function prints out a table of links to
36 * other parts of the system. If the user is an admin,
37 * it will print out links to administrative pages, also
40 function showQuickLinks() {
44 <table width
="100%" border
="0" cellspacing
="0" cellpadding
="0" align
="center">
47 <table width
="100%" border
="0" cellspacing
="0" cellpadding
="0">
49 <td
class="tableTitle" style
="background-color:#0F93DF;">
50 <?
=translate('My Quick Links')?
>
52 <td
class="tableTitle" style
="background-color:#0F93DF;"><div align
="right">
53 <?
$link->doLink("javascript: help('quick_links');", '?', '', 'color: #FFFFFF', translate('Help') . ' - ' . translate('My Quick Links')) ?
>
58 <table width
="100%" border
="0" cellspacing
="0" cellpadding
="0">
59 <tr style
="padding: 5px;" class="cellColor">
61 <?
echo "Quarantine Summary" == $_SESSION['sessionNav'] ?
62 ' <p class="selectedLink"><b>»</b>':
63 " <p><b>›</b>\t";
64 $link->doLink('summary.php', translate('Quarantine Summary')) ?
>
66 <?
echo "My Quarantine" == $_SESSION['sessionNav'] ?
67 ' <p class="selectedLink"><b>»</b>':
68 " <p><b>›</b>\t";
69 $link->doLink('messagesIndex.php?ctype=A', translate('My Quarantine'));
71 if (! Auth
::isMailAdmin()) {
72 echo "My Pending Requests" == $_SESSION['sessionNav'] ?
73 ' <p class="selectedLink"><b>»</b>':
74 " <p><b>›</b>\t";
75 $link->doLink('messagesPending.php?ctype=A', translate('My Pending Requests'));
81 <?
if (Auth
::isMailAdmin()) {
82 if ($conf['app']['siteSummary']) {
83 echo "Site Quarantine Summary" == $_SESSION['sessionNav'] ?
84 ' <p class="selectedLink"><b>»</b>':
85 " <p><b>›</b>\t";
86 $link->doLink('messagesSummary.php', translate('Site Quarantine Summary'));
90 echo "Site Quarantine" == $_SESSION['sessionNav'] ?
91 ' <p class="selectedLink"><b>»</b>':
92 " <p><b>›</b>\t";
93 $link->doLink('messagesAdmin.php?ctype=A&searchOnly='.$conf['app']['searchOnly'], translate('Site Quarantine'));
95 echo "Site Pending Requests" == $_SESSION['sessionNav'] ?
96 ' <p class="selectedLink"><b>»</b>':
97 " <p><b>›</b>\t";
98 $link->doLink('messagesPendingAdmin.php?ctype=A', translate('Site Pending Requests'));
102 if ((! Auth
::isMailAdmin()) && ($conf['app']['showEmailAdmin'])) {
103 echo "Email Administrator" == $_SESSION['sessionNav'] ?
104 ' <p class="selectedLink"><b>»</b>':
105 " <p><b>›</b>\t";
106 $link->doLink('send_mail.php', translate('Email Administrator'));
111 <?
$link->doLink('javascript: help();', translate('Help')) ?
>
115 <?
$link->doLink('index.php?logout=true', translate('Log Out')) ?
>
127 * Print out break to be used between tables
130 function printCpanelBr() {
131 echo '<p> </p>';
135 * Returns the proper expansion type for this table
136 * based on cookie settings
137 * @param string table name of table to check
138 * @return either 'block' or 'none'
140 function getShowHide($table) {
141 if (isset($_COOKIE[$table]) && $_COOKIE[$table] == 'show') {
149 * Returns the proper className for the rows of this table
150 * based on cookie settings
151 * @param string table name of table to check
152 * @return 'visible' or 'hidden'
154 function getShowHideHeaders($table) {
155 if (isset($_COOKIE[$table]) && $_COOKIE[$table] == 'visible') {
162 function startQuickLinksCol() {
164 <table width
="100%" border
="0" cellpadding
="0" cellspacing
="0">
166 <td style
="vertical-align:top; width:16%; border:solid 2px #0F93DF; background-color:#FFFFFF;">
170 function startDataDisplayCol() {
173 <td style
="padding-left:5px; vertical-align:top;">
177 function endDataDisplayCol() {
186 * Print 'Release', 'Delete' and 'Delete All' buttons
187 * @param string $content_type: 'S' (default), 'B', ...
188 * @param bool $printDeleteAll: if true (default) print 'Delete All' button
190 function printActionButtons( $printDeleteAll = true ) {
192 <table width
="100%" border
="0" cellspacing
="1" cellpadding
="0">
195 echo "<td align=\"left\"><input type=\"submit\" class=\"button\" name=\"action\" value=\"";
196 if ($_SESSION['sessionNav'] == "My Pending Requests") {
197 echo ( Auth
::isMailAdmin() ?
translate('Release') : translate('Cancel Request') );
200 echo ( Auth
::isMailAdmin() ?
translate('Release') : translate('Release/Request release') );
204 <td align
="right"><input type
="submit" class="button" name
="action" value
="<? echo translate('Delete'); ?>">
205 <?
if ( $printDeleteAll )
206 echo "<input type=\"submit\" class=\"button\" name=\"action\" value=\"".translate('Delete All')."\">";
215 * Print 'Send Error Report' buttons
216 * @param string $query_string
217 * @param array $error_array
219 function printReportButtons( $query_string, $error_array, $process_action ) {
221 $serialized_error_array = urlencode(serialize($error_array));
223 <form name
="error_report_form" action
="sendErrorReport.php" method
="POST">
224 <table width
="100%" border
="0" cellspacing
="1" cellpadding
="0">
226 <input type
="hidden" name
="query_string" value
="<? echo $query_string; ?> ">
227 <input type
="hidden" name
="serialized_error_array" value
="<? echo $serialized_error_array; ?>">
228 <input type
="hidden" name
="process_action" value
="<? echo $process_action ;?>">
230 <input type
="submit" class="button" name
="action" value
="<? echo translate('Send report and go back'); ?>"> 
;
231 <input type
="submit" class="button" name
="action" value
="<? echo translate('Go back'); ?>">
240 * Print Message and flushes the output buffer.
243 function printMessage($message) {
244 $id = urlencode($message);
246 <div align
="center" id
="<? echo $id; ?>" style
="display:block;">
247 <H4
><?
echo $message; ?
></H4
>
255 * Hides Message crested with printMessage and flushes the output buffer.
257 function hideMessage($message) {
258 $id = urlencode($message);
259 echo "<script> document.getElementById('$id').style.display='none'; </script>";