*/
include('../include/init.php');
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
- "http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd">
+displayHtmlHeader($org_title .': '. _("AddressBook"), '', false, true);
-<html>
- <head>
- <meta name="robots" content="noindex,nofollow">
- <title><?php echo "$org_title: " . _("Address Book"); ?></title>
- </head>
- <frameset rows="60,*" border="0">
- <frame name="abookmain"
- marginwidth="0"
- scrolling="no"
- border="0"
- src="addrbook_search.php?show=form" />
- <frame name="abookres"
- marginwidth="0"
- border="0"
- src="addrbook_search.php?show=blank" />
- </frameset>
-</html>
\ No newline at end of file
+$oTemplate->display('addressbook_popup.tpl');
+
+$oTemplate->display('footer.tpl');
+?>
\ No newline at end of file
<?php
-
/**
* addrbook_search.php
*
include_once(SM_PATH . 'functions/forms.php');
include_once(SM_PATH . 'functions/addressbook.php');
-
-/**
- * Function to include JavaScript code
- * @return void
- */
-function insert_javascript() {
- ?>
- <script type="text/javascript"><!--
-
- function to_and_close($addr) {
- to_address($addr);
- parent.close();
- }
-
- function to_address($addr) {
- var prefix = "";
- var pwintype = typeof parent.opener.document.compose;
-
- $addr = $addr.replace(/ {1,35}$/, "");
-
- if (pwintype != "undefined") {
- if (parent.opener.document.compose.send_to.value) {
- prefix = ", ";
- parent.opener.document.compose.send_to.value =
- parent.opener.document.compose.send_to.value + ", " + $addr;
- } else {
- parent.opener.document.compose.send_to.value = $addr;
- }
- }
- }
-
- function cc_address($addr) {
- var prefix = "";
- var pwintype = typeof parent.opener.document.compose;
-
- $addr = $addr.replace(/ {1,35}$/, "");
-
- if (pwintype != "undefined") {
- if (parent.opener.document.compose.send_to_cc.value) {
- prefix = ", ";
- parent.opener.document.compose.send_to_cc.value =
- parent.opener.document.compose.send_to_cc.value + ", " + $addr;
- } else {
- parent.opener.document.compose.send_to_cc.value = $addr;
- }
- }
- }
-
- function bcc_address($addr) {
- var prefix = "";
- var pwintype = typeof parent.opener.document.compose;
-
- $addr = $addr.replace(/ {1,35}$/, "");
-
- if (pwintype != "undefined") {
- if (parent.opener.document.compose.send_to_bcc.value) {
- prefix = ", ";
- parent.opener.document.compose.send_to_bcc.value =
- parent.opener.document.compose.send_to_bcc.value + ", " + $addr;
- } else {
- parent.opener.document.compose.send_to_bcc.value = $addr;
- }
- }
- }
-
-// --></script>
-<?php
-} /* End of included JavaScript */
-
+include_once(SM_PATH . 'templates/util_addressbook.php');
/**
* List search results
* @return void
*/
function display_result($res, $includesource = true) {
- global $color;
+ global $oTemplate, $oErrorHandler;
if(sizeof($res) <= 0) return;
- insert_javascript();
-
- $line = 0;
- echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) .
- html_tag( 'tr', '', '', $color[9] ) .
- html_tag( 'th', ' ', 'left' ) .
- html_tag( 'th', ' ' . _("Name"), 'left' ) .
- html_tag( 'th', ' ' . _("E-mail"), 'left' ) .
- html_tag( 'th', ' ' . _("Info"), 'left' );
-
- if ($includesource) {
- echo html_tag( 'th', ' ' . _("Source"), 'left', '', 'width="10%"' );
- }
- echo "</tr>\n";
-
- while (list($undef, $row) = each($res)) {
- $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES);
- if ($line % 2) {
- $tr_bgcolor = $color[12];
- } else {
- $tr_bgcolor = $color[4];
- }
- echo html_tag( 'tr', '', '', $tr_bgcolor, 'style="white-space: nowrap;"' ) .
- html_tag( 'td',
- '<small><a href="javascript:to_address(' .
- "'" . $email . "');\">"._("To")."</a> | " .
- '<a href="javascript:cc_address(' .
- "'" . $email . "');\">"._("Cc")."</a> | " .
- '<a href="javascript:bcc_address(' .
- "'" . $email . "');\">"._("Bcc")."</a></small>",
- 'center', '', 'valign="top" width="5%" style="white-space: nowrap;"' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['name']), 'left', '', 'valign="top" style="white-space: nowrap;"' ) .
- html_tag( 'td', ' ' .
- '<a href="javascript:to_and_close(' .
- "'" . $email . "');\">" . htmlspecialchars($row['email']) . '</a>'
- , 'left', '', 'valign="top"' ) .
- html_tag( 'td', htmlspecialchars($row['label']), 'left', '', 'valign="top" style="white-space: nowrap;"' );
- if ($includesource) {
- echo html_tag( 'td', ' ' . $row['source'], 'left', '', 'valign="top" style="white-space: nowrap;"' );
- }
-
- echo "</tr>\n";
- $line++;
- }
- echo '</table>';
+ $oTemplate->assign('use_js', true);
+ $oTemplate->assign('include_abook_name', $includesource);
+ $oTemplate->assign('addresses', formatAddressList($res));
+
+ $oTemplate->display('addrbook_search_list.tpl');
}
/* ================= End of functions ================= */
}
displayHtmlHeader();
+echo "<body>\n";
/** set correct value of $default_charset */
global $default_charset;
set_my_charset();
-/* Choose correct colors for top and bottom frame */
-if ($show == 'form' && !isset($listall)) {
- echo '<body text="' . $color[6] . '" bgcolor="' . $color[3] . '" ' .
- 'link="' . $color[6] . '" vlink="' . $color[6] . '" ' .
- 'alink="' . $color[6] . '" ' .
- 'OnLoad="document.sform.query.focus();">';
-} else {
- echo '<body text="' . $color[8] . '" bgcolor="' . $color[4] . '" ' .
- 'link="' . $color[7] . '" vlink="' . $color[7] . '" ' .
- 'alink="' . $color[7] . "\">\n";
-}
-
/* Empty search */
if (empty($query) && empty($show) && !isset($listall)) {
- echo html_tag( 'p', '<br />' .
- _("No persons matching your search were found"),
- 'center' ) .
- "\n</body></html>\n";
- exit;
+ $oTemplate->assign('note', htmlspecialchars(_("No persons matching your search were found")));
+ $oTemplate->display('note.tpl');
+# exit;
}
/* Initialize addressbook, show init errors only in bottom frame */
/* Create search form (top frame) */
if ($show == 'form' && ! isset($listall)) {
- echo '<form name="sform" target="abookres" action="addrbook_search.php'.
- '" method="post">' . "\n" .
- html_tag( 'table', '', '', '', 'border="0" width="100%" height="100%"' ) .
- html_tag( 'tr' ) .
- html_tag( 'td', ' <strong><label for="query">' . _("Search for") .
- "</label></strong>\n", 'left', '',
- 'style="white-space: nowrap;" valign="middle" width="10%"' ) .
- html_tag( 'td', '', 'left', '', '' ) .
- addInput('query', $query, 28);
-
- /* List all backends to allow the user to choose where to search */
- if ($abook->numbackends > 1) {
- echo '<strong><label for="backend">' . _("in") . '</label></strong> '."\n";
- $selopts = array();
- $selopts['-1'] = _("All address books");
-
- $ret = $abook->get_backend_list();
- while (list($undef,$v) = each($ret)) {
- $selopts[$v->bnum] = $v->sname;
- }
- echo addSelect('backend', $selopts, '-1', TRUE);
- } else {
- echo addHidden('backend', '-1');
- }
-
- echo '</td></tr>' .
- html_tag( 'tr',
- html_tag( 'td', '', 'left' ) .
- html_tag( 'td',
- '<input type="submit" value="' . _("Search") . '" name="show" />' .
- ' | <input type="submit" value="' . _("List all") .
- '" name="listall" />' . "\n" .
- ' | <input type="button" value="' . _("Close") .
- '" onclick="parent.close();" />' . "\n" ,
- 'left' )
- ) .
- '</table></form>' . "\n";
+ echo "<form name=\"sform\" target=\"abookres\" action=\"addrbook_search.php\" method=\"POST\">\n";
+
+ $oTemplate->assign('use_js', true);
+ $oTemplate->assign('backends', getBackends());
+ $oTemplate->display('addressbook_search_form.tpl');
+
+ echo "</form>\n";
} else {
/**
* List addresses (bottom frame)
usort($res,'alistcmp');
display_result($res, false);
} else {
- echo html_tag( 'p', '<strong>' .
- sprintf(_("Unable to list addresses from %s"),
- $abook->backends[$backend]->sname) . '</strong>' ,
- 'center' ) . "\n";
+ plain_error_message(sprintf(_("Unable to list addresses from %s"), $abook->backends[$backend]->sname));
}
} else {
$res = $abook->list_addr();
}
if (!is_array($res)) {
- echo html_tag( 'p', '<b><br />' .
- _("Your search failed with the following error(s)") .
- ':<br />' . nl2br(htmlspecialchars($abook->error)) . "</b>\n" ,
- 'center' );
+ plain_error_message( _("Your search failed with the following error(s)") .':<br />'. nl2br(htmlspecialchars($abook->error)) );
} elseif (sizeof($res) == 0) {
- echo html_tag( 'p', '<br /><b>' .
- _("No persons matching your search were found") . "</b>\n" ,
- 'center' );
+ $oTemplate->assign('note', _("No persons matching your search were found"));
+ $oTemplate->display('note.tpl');
} else {
display_result($res);
}
* listall is not set, query is not set or empty.
* User hit search button without entering search expression.
*/
- echo html_tag( 'p', '<br /><b>' . _("Nothing to search") . "</b>\n",'center' );
+ plain_error_message(_("Nothing to search"));
}
}
+
$oTemplate->display('footer.tpl');
-?>
+?>
\ No newline at end of file
/** SquirrelMail required files. */
include_once(SM_PATH . 'functions/date.php');
include_once(SM_PATH . 'functions/addressbook.php');
+include_once(SM_PATH . 'templates/util_addressbook.php');
sqgetGlobalVar('session', $session, SQ_POST);
sqgetGlobalVar('mailbox', $mailbox, SQ_POST);
-if (! sqgetGlobalVar('addrquery', $addrquery, SQ_POST))
+if (! sqgetGlobalVar('query', $addrquery, SQ_POST))
$addrquery='';
sqgetGlobalVar('listall', $listall, SQ_POST);
sqgetGlobalVar('backend', $backend, SQ_POST);
function addr_display_result($res, $includesource = true) {
global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
+ global $oTemplate, $oErrorHandler;
+
if (sizeof($res) <= 0) return;
- echo addForm($PHP_SELF, 'post', 'addrbook').
+ echo addForm($PHP_SELF, 'post', 'addressbook').
addHidden('html_addr_search_done', 'true');
addr_insert_hidden();
- $line = 0;
- if ($javascript_on) {
- print
- '<script type="text/javascript">' .
- "\n<!-- \n" .
- "function CheckAll(ch) {\n" .
- " for (var i = 0; i < document.addrbook.elements.length; i++) {\n" .
- " if( document.addrbook.elements[i].type == 'checkbox' &&\n" .
- " document.addrbook.elements[i].name.substr(0,16) == 'send_to_search['+ch ) {\n" .
- " document.addrbook.elements[i].checked = !(document.addrbook.elements[i].checked);\n".
- " }\n" .
- " }\n" .
- "}\n" .
- "//-->\n" .
- "</script>\n";
- $chk_all = '<a href="#" onclick="CheckAll(\'T\');">'._("All").'</a> <font color="'.$color[9].'">'._("To").'</font>'.
- ' '.
- '<a href="#" onclick="CheckAll(\'C\');">' . _("All") . '</a> <font color="'.$color[9].'">'._("Cc").'</font>'.
- ' '.
- '<a href="#" onclick="CheckAll(\'B\');">' . _("All") . '</a>';
- } else {
- // check_all links are used only in JavaScript. disable links in js=off environment.
- $chk_all = '';
- }
- echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) .
- html_tag( 'tr', '', '', $color[9] ) .
- html_tag( 'th', ' ' . $chk_all, 'left' ) .
- html_tag( 'th', ' ' . _("Name"), 'left' ) .
- html_tag( 'th', ' ' . _("E-mail"), 'left' ) .
- html_tag( 'th', ' ' . _("Info"), 'left' );
-
- if ($includesource) {
- echo html_tag( 'th', ' ' . _("Source"), 'left', '', 'width="10%"' );
- }
-
- echo "</tr>\n";
-
- foreach ($res as $row) {
- $email = AddressBook::full_address($row);
- if ($line % 2) {
- $tr_bgcolor = $color[12];
- } else {
- $tr_bgcolor = $color[4];
- }
-
- echo html_tag( 'tr', '', '', $tr_bgcolor, 'style="white-space: nowrap;"' ) .
- html_tag( 'td',
- addCheckBox('send_to_search[T'.$line.']', FALSE, $email).
- ' ' . _("To") . ' ' .
- addCheckBox('send_to_search[C'.$line.']', FALSE, $email).
- ' ' . _("Cc") . ' ' .
- addCheckBox('send_to_search[B'.$line.']', FALSE, $email).
- ' ' . _("Bcc") . ' ' ,
- 'center', '', 'width="5%" style="white-space: nowrap;"' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['name']) . ' ', 'left', '', 'style="white-space: nowrap;"' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'style="white-space: nowrap;"' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'style="white-space: nowrap;"' );
-
- if ($includesource) {
- echo html_tag( 'td', ' ' . $row['source'] . ' ', 'left', '', 'style="white-space: nowrap;"' );
- }
- echo "</tr>\n";
- $line ++;
- }
- if ($includesource) { $td_colspan = '5'; } else { $td_colspan = '4'; }
- echo html_tag( 'tr',
- html_tag( 'td',
- '<input type="submit" name="addr_search_done" value="' .
- _("Use Addresses") . '" /> ' .
- '<input type="submit" name="addr_search_cancel" value="' .
- _("Cancel") . '" />',
- 'center', '', 'colspan="'. $td_colspan .'"' )
- ) .
- '</table>' .
- addHidden('html_addr_search_done', '1').
- '</form>';
+ $oTemplate->assign('use_js', false);
+ $oTemplate->assign('include_abook_name', $includesource);
+ $oTemplate->assign('addresses', formatAddressList($res));
+
+ $oTemplate->display('addrbook_search_list.tpl');
+
+ echo '</form>';
}
/* --- End functions --- */
$abook = addressbook_init();
-echo '<br />' .
-html_tag( 'table',
- html_tag( 'tr',
- html_tag( 'td', '<b>' . _("Address Book Search") . '</b>', 'center', $color[0] )
- ) ,
-'center', '', 'width="95%" cellpadding="2" cellspacing="2" border="0"' );
-
-
/* Search form */
-echo '<div style="text-align: center;">' .
- html_tag( 'table', '', 'center', '', 'border="0"' ) .
- html_tag( 'tr' ) .
- html_tag( 'td', '', 'left', '', 'style="white-space: nowrap;" valign="middle"' ) . "\n" .
- addForm($PHP_SELF.'?html_addr_search=true', 'post', 'f').
- "\n<div style=\"text-align: center;\">\n" .
- ' <nobr><strong>' . _("Search for") . "</strong>\n";
+echo addForm($PHP_SELF.'?html_addr_search=true', 'post', 'f');
addr_insert_hidden();
-echo addInput('addrquery', $addrquery, 26);
-
-/* List all backends to allow the user to choose where to search */
-if (!isset($backend)) { $backend = ''; }
-if ($abook->numbackends > 1) {
- echo '<strong>' . _("in") . '</strong> ';
-
- $selopts['-1'] = _("All address books");
- $ret = $abook->get_backend_list();
-
- while (list($undef,$v) = each($ret)) {
- $selopts[$v->bnum] = $v->sname;
- }
- echo addSelect('backend', $selopts, $backend, TRUE);
-} else {
- echo addHidden('backend', '-1');
-}
if (isset($session)) {
echo addHidden('session', $session);
}
-echo '<input type="submit" value="' . _("Search") . '" />' .
- ' | <input type="submit" value="' . _("List all") .
- '" name="listall" />' . "\n" .
- '</form></div></td></tr></table>' . "\n";
-echo '</div>';
+$oTemplate->assign('use_js', false);
+$oTemplate->assign('backends', getBackends());
+
+$oTemplate->display('addressbook_search_form.tpl');
+
+echo "</form>\n";
do_hook('addrbook_html_search_below');
/* End search form */
usort($res,'alistcmp');
addr_display_result($res, false);
} else {
- echo html_tag( 'p', '<strong><br />' .
- sprintf(_("Unable to list addresses from %s"),
- $abook->backends[$backend]->sname) . "</strong>\n" ,
- 'center' );
+ plain_error_message(_("Unable to list addresses from %s"), $abook->backends[$backend]->sname);
}
} else {
}
if (!is_array($res)) {
- echo html_tag( 'p', '<b><br />' .
- _("Your search failed with the following error(s)") .
- ':<br />' . nl2br(htmlspecialchars($abook->error)) . "</b>\n" ,
- 'center' ) . "\n";
- $oTemplate->display('footer.tpl');
+ plain_error_message(_("Your search failed with the following error(s)") .':<br />'. nl2br(htmlspecialchars($abook->error)));
+ } elseif (sizeof($res) == 0) {
+ $oTemplate->assign('note', _("No persons matching your search were found"));
+ $oTemplate->display('note.tpl');
} else {
- if (sizeof($res) == 0) {
- echo html_tag( 'p', '<br /><b>' .
- _("No persons matching your search were found") . "</b>\n" ,
- 'center' ) . "\n";
- $oTemplate->display('footer.tpl');
- } else {
- addr_display_result($res);
- }
+ addr_display_result($res);
}
} else {
// not first time display, not listall and search is empty
// TODO: I think, this part of control structure is never reached.
- echo html_tag( 'p', '<br /><b>' .
- _("Nothing to search") . "</b>\n" ,
- 'center' );
+ plain_error_message(_("Nothing to search"));
}
if ($addrquery == '' || sizeof($res) == 0) {
'</form></div></nobr>';
}
+echo '<hr />';
+
$oTemplate->display('footer.tpl');
?>
\ No newline at end of file
/** SquirrelMail required files. */
/* address book functions */
require_once(SM_PATH . 'functions/addressbook.php');
+include_once(SM_PATH . 'templates/util_addressbook.php');
+
/* form functions */
require_once(SM_PATH . 'functions/forms.php');
if ($start >= $count) $start = 0;
$alist = array_slice($alist,$start,15);
- while(list($undef,$row) = each($alist)) {
- $contact = array (
- 'FirstName' => htmlspecialchars($row['firstname']),
- 'LastName' => htmlspecialchars($row['lastname']),
- 'FullName' => htmlspecialchars($row['name']),
- 'NickName' => htmlspecialchars($row['nickname']),
- 'Email' => htmlspecialchars($row['email']),
- 'FullAddress' => htmlspecialchars($abook->full_address($row)),
- 'Info' => htmlspecialchars($row['label']),
- 'Extra' => (isset($row['extra']) ? $row['extra'] : NULL),
- );
- $a['Addresses'][] = $contact;
- }
+ $a['Addresses'] = formatAddressList($alist);
$addresses[$backend->bnum] = $a;
}
--- /dev/null
+<?php
+/**
+ * addrbook_search_list.tpl
+ *
+ * Display a list of addresses from the search forms
+ *
+ * The following variables are available in this template:
+ * $use_js - boolean TRUE if we should use Javascript in this book.
+ * $include_abook_name - boolean TRUE if the resuls should also display
+ * the name of the address book the result is in.
+ * $addresses - array containing search results. Each element contains the
+ * following fields:
+ * $el['FirstName'] - The entry's first name
+ * $el['LastName'] - The entry's last name (surname)
+ * $el['FullName'] - The entry's full name (first + last)
+ * $el['NickName'] - The entry's nickname
+ * $el['Email'] - duh
+ * $el['FullAddress'] - Email with full name or nick name
+ * optionally prepended.
+ * $el['Info'] - Additional info about this contact
+ * $el['Extra'] - Additional field, if provided. NULL if this
+ * field is not provided by the book.
+ * $el['JSEmail'] - email address scrubbed for use with
+ * javascript functions.
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+
+/** extract template variables **/
+extract($t);
+
+/** Begin template **/
+$colspan = $include_abook_name ? 5 : 4;
+?>
+<?php
+if ($use_js) {
+ insert_javascript();
+}
+?>
+<div id="addressList">
+<table cellspacing="0">
+ <tr>
+ <td class="colHeader" style="width:1%"></td>
+ <td class="colHeader"><?php echo _("Name"); ?></td>
+ <td class="colHeader"><?php echo _("E-mail"); ?></td>
+ <td class="colHeader"><?php echo _("Info"); ?></td>
+ <?php
+ if ($include_abook_name) {
+ echo '<td class="colHeader">'. _("Source") .'</td>';
+ }
+ ?>
+ </tr>
+ <?php
+ if (count($addresses) == 0) {
+ echo '<tr><td class="abookEmpty" colspan="'.$colspan.'">'._("Address book is empty").'</td></tr>'."\n";
+ }
+ foreach ($addresses as $index=>$contact) {
+ ?>
+ <tr class=<?php echo '"'.(($index+1)%2 ? 'even' : 'odd').'"'; ?>>
+ <td class="abookCompose" style="width:1%">
+ <?php
+ if ($use_js) {
+ ?>
+ <a href="javascript:to_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("To"); ?></a> |
+ <a href="javascript:cc_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("Cc"); ?></a> |
+ <a href="javascript:bcc_address('<?php echo $contact['JSEmail']; ?>')"><?php echo _("Bcc"); ?></a>
+ <?php
+ } else {
+ ?>
+ <input type="checkbox" name=<?php echo '"send_to_search[T'.$index.']"'; ?> value=<?php echo '"'.$contact['FullAddress'].'"'; ?> id=<?php echo '"send_to_search_T'.$index.'_"'; ?>><label for=<?php echo '"send_to_search_T'.$index.'_"'; ?>><?php echo _("To"); ?></label>
+ <input type="checkbox" name=<?php echo '"send_to_search[C'.$index.']"'; ?> value=<?php echo '"'.$contact['FullAddress'].'"'; ?> id=<?php echo '"send_to_search_C'.$index.'_"'; ?>><label for=<?php echo '"send_to_search_C'.$index.'_"'; ?>><?php echo _("Cc"); ?></label>
+ <input type="checkbox" name=<?php echo '"send_to_search[B'.$index.']"'; ?> value=<?php echo '"'.$contact['FullAddress'].'"'; ?> id=<?php echo '"send_to_search_B'.$index.'_"'; ?>><label for=<?php echo '"send_to_search_B'.$index.'_"'; ?>><?php echo _("Bcc"); ?></label>
+ <?php
+ }
+ ?>
+ </td>
+ <td class="abookField"><?php echo $contact['FullName']; ?></td>
+ <td class="abookField"><a href="javascript:to_and_close('<?php echo $contact['JSEmail']; ?>')"><?php echo $contact['Email']; ?></a></td>
+ <td class="abookField"><?php echo $contact['Info']; ?></td>
+ <?php
+ if ($include_abook_name) {
+ echo '<td class="abookField">'.$contact['Source'].'</td>'."\n";
+ }
+ ?>
+ </tr>
+ <?php
+ }
+?>
+</table>
+<?php
+if (!$use_js) {
+ echo '<input type="submit" name="addr_search_done" value="'. _("Use Addresses") .'" />'."\n";
+ echo '<input type="submit" name="addr_search_cancel" value="'. _("Cancel") .'" />'."\n";
+}
+?>
+</div>
\ No newline at end of file
* $el['Info'] - Additional info about this contact
* $el['Extra'] - Additional field, if provided. NULL if this
* field is not provided by the book.
+ * $el['JSEmail'] - email address scrubbed for use with
+ * javascript functions.
*
* @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
/** extract template variables **/
extract($t);
-#echo dump_array($addresses).'<br>';
/** Begin template **/
$source = $addresses[$current_backend];
$colspan = $abook_has_extra_field ? 6 : 5;
--- /dev/null
+<?php
+/**
+ * addressbook_popup.tpl
+ *
+ * Description
+ *
+ * The following variables are available in this template:
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+
+/** extract template variables **/
+extract($t);
+
+/** Begin template **/
+?>
+<frameset rows="80,*" border="0">
+ <frame name="abookmain"
+ marginwidth="0"
+ scrolling="no"
+ border="0"
+ src="addrbook_search.php?show=form" />
+ <frame name="abookres"
+ marginwidth="0"
+ border="0"
+ src="addrbook_search.php?show=blank" />
+</frameset>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * addressbook_search_form.tpl
+ *
+ * Display the form for searching the address book. Called from addrbook_search.php
+ *
+ * The following variables are available in this template:
+ * $use_js - boolean TRUE if we should use Javascript in the address book
+ * $backends - array containing list of all available backends.
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+
+/** extract template variables **/
+extract($t);
+
+/** Begin template **/
+?>
+<div id="addrBookSearch">
+<table cellspacing="0" class="wrapper">
+ <tr>
+ <td class="header2">
+ <?php echo _("Address book search"); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+<table cellspacing="0">
+ <tr>
+ <td>
+ <label for="query"><?php echo _("Search for"); ?>:</label>
+ </td>
+ <td>
+ <input type="text" id="query" name="query" />
+ </td>
+ <td>
+ <?php
+ if (count($backends) > 1) {
+ ?>
+ <label for="backend"><?php echo _("in"); ?></label>
+ <select name="backend" id="backend">
+ <?php
+ foreach ($backends as $id=>$name) {
+ echo '<option value="'.$id.'">'.htmlspecialchars($name).'</option>'."\n";
+ }
+ ?>
+ </select>
+ <?php
+ } else {
+ ?>
+ <input type="hidden" name="backend" value="-1">
+ <?php
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" class="buttons">
+ <input type="submit" name="show" value=<?php echo '"'._("Search").'"'; ?> />
+
+ <input type="submit" name="listall" value=<?php echo '"'._("List all").'"'; ?> />
+ <?php
+ if ($use_js) {
+ ?>
+
+ <input type="submit" onclick="parent.close()" value=<?php echo '"'._("Close").'"'; ?> />
+ <?php
+ }
+ ?>
+ </td>
+ </tr>
+</table>
+ </td>
+ </tr>
+</table>
+</div>
\ No newline at end of file
}
#addressList input {
- font-size: 75%;
+ font-size: 8pt;
}
#addressList select {
#addressList table {
margin-left: auto;
margin-right: auto;
- width: 90%;
+ width: 95%;
border: 1px solid <?php echo $color[9]; ?>;
margin-top: 8px;
margin-bottom: 8px;
#addressList td.abookField {
border-left: 1px solid <?php echo $color[9]; ?>;
border-right: 1px solid <?php echo $color[9]; ?>;
+ white-space: nowrap;
+ overflow: hidden;
}
#addressList td.colHeader {
#addressList td.abookEmpty {
text-align:center;
font-weight: bold;
+}
+
+#addressList td.abookCompose {
+ font-size: 8pt;
+ white-space: nowrap;
+}
+
+#addrBookSearch {
+ text-align: center;
+}
+
+#addrBookSearch table {
+ padding: 0;
+ border: 0;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+#addrBookSearch table.wrapper {
+ border: 1px solid <?php echo $color[9]; ?>;
+ width: 95%;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 0;
+}
+
+#addrBookSearch td {
+ padding: 2px;
+}
+
+#addrBookSearch label {
+ font-weight: bold;
+}
+
+#addrBookSearch input {
+ font-size: 75%;
+}
+
+#addrBookSearch select {
+ font-size: 75%;
+}
+
+#addrBookSearch td.buttons {
+ text-align: center;
}
\ No newline at end of file