Source for file addrbook_search_html.php
Documentation is available at addrbook_search_html.php
* addrbook_search_html.php
* Handle addressbook searching with pure html.
* This file is included from compose.php
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: addrbook_search_html.php 14845 2020-01-07 08:09:34Z pdontthink $
* @subpackage addressbook
* Include the SquirrelMail initialization file.
* Because this file can also be included within compose we check for the $bInit
* var which is set inside ini.php. It's needed because compose already includes
/** This is the addrbook_search_html page */
define('PAGE_NAME', 'addrbook_search_html');
include('../include/init.php');
/** 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');
global $body, $subject, $send_to, $send_to_cc, $send_to_bcc, $mailbox, $mailprio,
$request_mdn, $request_dr, $identity, $session, $composeMessage, $action;
//FIXME Do not echo HTML from the core. This file already uses templates mostly, so why are we echoing here at all?!?
// someone tell me why this is needed and if so, why it isn't something like replace \r\n with \n
// if (substr($body, 0, 1) == "\r") {
// echo addHidden('body', "\n".$body);
if (is_object($composeMessage) &&
$composeMessage->entities)
* @param array $res Array containing results of search
* @param bool $includesource If true, adds backend column to address listing
global $PHP_SELF, $oTemplate, $oErrorHandler;
//FIXME: no HTML output from core
echo
addForm($PHP_SELF, 'post', 'addressbook', '', '', array(), TRUE).
$oTemplate->assign('compose_addr_pop', false);
$oTemplate->assign('include_abook_name', $includesource);
$oTemplate->display('addrbook_search_list.tpl');
/* --- End functions --- */
if ($compose_new_win ==
'1') {
/** set correct value of $default_charset */
/* Initialize addressbook */
echo
addForm($PHP_SELF.
'?html_addr_search=true', 'post', 'f');
$oTemplate->assign('compose_addr_pop', false);
$oTemplate->display('addressbook_search_form.tpl');
do_hook('addrbook_html_search_below', $null);
/* List addresses. Show personal addressbook */
if ($addrquery ==
'' ||
! empty($listall)) {
// TODO: recheck all conditions and simplity if statements
if (! isset
($backend) ||
$backend != -
1 ||
$addrquery ==
'') {
if ($addrquery ==
'' &&
empty($listall)) {
$backend =
$abook->localbackend;
$res =
$abook->list_addr($backend);
$res =
$abook->list_addr();
$oTemplate->display('footer.tpl');
} elseif (!empty($addrquery)) {
$res =
$abook->s_search($addrquery);
$res =
$abook->s_search($addrquery, $backend);
} elseif (sizeof($res) ==
0) {
$oTemplate->assign('note', _("No persons matching your search were found"));
$oTemplate->display('note.tpl');
// not first time display, not listall and search is empty
// TODO: I think, this part of control structure is never reached.
if ($addrquery ==
'' ||
sizeof($res) ==
0) {
//FIXME don't echo HTML from core -- especially convoluted given that there is template code immediately above AND below this block
echo
'<div style="text-align: center;">'.
addForm('compose.php','post','k', '', '', array(), TRUE);
echo
'<input type="submit" value="' .
_("Return") .
'" name="return" />' .
"\n" .
$oTemplate->display('footer.tpl');
Documentation generated on Mon, 13 Jan 2020 04:21:58 +0100 by phpDocumentor 1.4.3