configured
[bMailZu.git] / templates / common.template.php
blob20d7abd366ad72b8271f6d55192c478b125e1157
1 <?php
2 /**
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:
7 * - showQuickLinks()
8 * - printCpanelBr()
9 * - getShowHide()
10 * - getShowHideHeaders()
11 * - startQuickLinksCol()
12 * - startDataDisplayCol()
13 * - endDataDisplayCol()
14 * @author Nick Korbel <lqqkout13@users.sourceforge.net>
15 * @author Adam Moore
16 * @author David Poole <David.Poole@fccc.edu>
17 * @version 04-03-07
18 * @package Templates
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
30 // Get Link object
31 $link = CmnFns::getNewLink();
33 /**
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
38 * @param none
40 function showQuickLinks() {
41 global $conf;
42 global $link;
44 <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
45 <tr>
46 <td>
47 <table width="100%" border="0" cellspacing="0" cellpadding="0">
48 <tr>
49 <td class="tableTitle" style="background-color:#0F93DF;">
50 <?=translate('My Quick Links')?>
51 </td>
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')) ?>
54 </div>
55 </td>
56 </tr>
57 </table>
58 <table width="100%" border="0" cellspacing="0" cellpadding="0">
59 <tr style="padding: 5px;" class="cellColor">
60 <td colspan="2">
61 <? echo "Quarantine Summary" == $_SESSION['sessionNav'] ?
62 ' <p class="selectedLink"><b>&raquo;</b>':
63 " <p><b>&#8250;</b>\t";
64 $link->doLink('summary.php', translate('Quarantine Summary')) ?>
65 </p>
66 <? echo "My Quarantine" == $_SESSION['sessionNav'] ?
67 ' <p class="selectedLink"><b>&raquo;</b>':
68 " <p><b>&#8250;</b>\t";
69 $link->doLink('messagesIndex.php?ctype=A', translate('My Quarantine'));
70 echo '</p>';
71 if (! Auth::isMailAdmin()) {
72 echo "My Pending Requests" == $_SESSION['sessionNav'] ?
73 ' <p class="selectedLink"><b>&raquo;</b>':
74 " <p><b>&#8250;</b>\t";
75 $link->doLink('messagesPending.php?ctype=A', translate('My Pending Requests'));
76 echo '</p>';
79 </p>
80 <br>
81 <? if (Auth::isMailAdmin()) {
82 if ($conf['app']['siteSummary']) {
83 echo "Site Quarantine Summary" == $_SESSION['sessionNav'] ?
84 ' <p class="selectedLink"><b>&raquo;</b>':
85 " <p><b>&#8250;</b>\t";
86 $link->doLink('messagesSummary.php', translate('Site Quarantine Summary'));
87 echo '</p>';
90 echo "Site Quarantine" == $_SESSION['sessionNav'] ?
91 ' <p class="selectedLink"><b>&raquo;</b>':
92 " <p><b>&#8250;</b>\t";
93 $link->doLink('messagesAdmin.php?ctype=A&searchOnly='.$conf['app']['searchOnly'], translate('Site Quarantine'));
94 echo '</p>';
95 echo "Site Pending Requests" == $_SESSION['sessionNav'] ?
96 ' <p class="selectedLink"><b>&raquo;</b>':
97 " <p><b>&#8250;</b>\t";
98 $link->doLink('messagesPendingAdmin.php?ctype=A', translate('Site Pending Requests'));
99 echo '</p>';
100 echo '<br>';
102 if ((! Auth::isMailAdmin()) && ($conf['app']['showEmailAdmin'])) {
103 echo "Email Administrator" == $_SESSION['sessionNav'] ?
104 ' <p class="selectedLink"><b>&raquo;</b>':
105 " <p><b>&#8250;</b>\t";
106 $link->doLink('send_mail.php', translate('Email Administrator'));
107 echo ' </p>';
110 <p><b>&#8250;</b>
111 <? $link->doLink('javascript: help();', translate('Help')) ?>
112 </p>
113 <br>
114 <p><b>&#8250;</b>
115 <? $link->doLink('index.php?logout=true', translate('Log Out')) ?>
116 </p>
117 </td>
118 </tr>
119 </table>
120 </td>
121 </tr>
122 </table>
127 * Print out break to be used between tables
128 * @param none
130 function printCpanelBr() {
131 echo '<p>&nbsp;</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') {
142 return 'block';
144 else
145 return 'none';
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') {
156 return 'visible';
157 } else {
158 return 'hidden';
162 function startQuickLinksCol() {
164 <table width="100%" border="0" cellpadding="0" cellspacing="0">
165 <tr>
166 <td style="vertical-align:top; width:16%; border:solid 2px #0F93DF; background-color:#FFFFFF;">
170 function startDataDisplayCol() {
172 </td>
173 <td style="padding-left:5px; vertical-align:top;">
177 function endDataDisplayCol() {
179 </td>
180 </tr>
181 </table>
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">
193 <tr>
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') );
199 } else {
200 echo ( Auth::isMailAdmin() ? translate('Release') : translate('Release/Request release') );
202 echo "\"></td>";
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')."\">";
208 </td>
209 </tr>
210 </table>
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">
225 <tr>
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 ;?>">
229 <td><center>
230 <input type="submit" class="button" name="action" value="<? echo translate('Send report and go back'); ?>">&nbsp;
231 <input type="submit" class="button" name="action" value="<? echo translate('Go back'); ?>">
232 </center></td>
233 </tr>
234 </table>
235 </form>
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>
248 </div>
250 ob_flush();
251 flush();
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>";
260 ob_flush();
261 flush();