From: teepe Date: Mon, 24 Dec 2001 19:01:55 +0000 (+0000) Subject: style police X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=b0c396652f1ba7ae259a6998105f95d0fbcf0531 style police git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1919 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/addrbook_search.php b/src/addrbook_search.php index d5e027d5..fa5fa570 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -33,229 +33,236 @@ require_once('../src/validate.php'); - // Function to include JavaScript code - function insert_javascript() { -?> - - '; - printf(" ". - " %s %s". - " %s", - _("Name"), _("E-mail"), _("Info")); + insert_javascript(); - if($includesource) - printf(" %s", _("Source")); - - echo "\n"; - - while(list($undef, $row) = each($res)) { - printf("". - "To | ". - "Cc | ". - "Bcc". - " %s ". - " %s ". - " %s ", - ($line % 2) ? " bgcolor=\"$color[0]\"" : "", - $row["email"], $row["email"], $row["email"], - $row["name"], $row["email"], $row["email"], - $row["label"]); - - if($includesource) - printf(" %s", $row["source"]); + $line = 0; + echo '' . + '\n"; - echo "\n"; - $line++; + while (list($undef, $row) = each($res)) { + echo '
 ' . + ' ' . _("Name") . + ' ' . _("E-mail") . + ' ' . _("Info"); + + if ($includesource) { + echo ' ' . _("Source"); + } + echo "
' . + 'To | " . + 'Cc | " . + 'Bcc" . + ' ' . + $row['name'] . ' ' . + ' " . $row["email'] . ' ' . + ' ' . $row['label'] . ' '; + if ($includesource) { + echo ' ' . $row['source']; } - echo '
'; + + echo "\n"; + $line++; } + echo ''; +} - /* ================= End of functions ================= */ +/* ================= End of functions ================= */ - require_once('../functions/array.php'); - require_once('../functions/strings.php'); - require_once('../functions/addressbook.php'); +require_once('../functions/array.php'); +require_once('../functions/strings.php'); +require_once('../functions/addressbook.php'); - displayHtmlHeader(); +displayHtmlHeader(); - // Initialize vars - if(!isset($query)) $query = ""; - if(!isset($show)) $show = ""; +/* Initialize vars */ +if (!isset($query)) { $query = ''; } +if (!isset($show)) { $show = ''; } - // Choose correct colors for top and bottom frame - if($show == 'form') { - echo "'; - } else { - echo "\n"; - } +/* Choose correct colors for top and bottom frame */ +if ($show == 'form') { + echo ''; +} else { + echo '\n"; +} - // Empty search - if(empty($query) && empty($show) && empty($listall)) { - printf("


%s

\n\n", - _("No persons matching your search was found")); - exit; - } +/* Empty search */ +if (empty($query) && empty($show) && empty($listall)) { + echo '


' . + _("No persons matching your search was found") . + "

\n\n", + exit; +} - // Initialize addressbook - $abook = addressbook_init(); +/* Initialize addressbook */ +$abook = addressbook_init(); - // Create search form - if($show == 'form') { - echo "
\n"; - echo ''; - echo "
\n"; - printf(" %s\n", _("Search for")); - printf(" \n", - htmlspecialchars($query)); - - // List all backends to allow the user to choose where to search - if($abook->numbackends > 1) { - printf("%s \n"; - } else { - print "\n"; +/* Create search form */ +if ($show == 'form') { + echo '' . "\n" . + '' . + '
' . "\n" . + ' ' . _("Search for") . "\n" . + ' \n", + + /* List all backends to allow the user to choose where to search */ + if ($abook->numbackends > 1) { + echo '' . _("in") . ' \n"; + } else { + echo '' . "\n"; + } - printf("", - _("Search")); - printf(" | \n", - _("List all")); - print "\n"; - printf("\n", - _("Close window")); - print "
\n"; - } else + echo '' . + ' | ' . "\n" . + '
' . "\n" . + '' . "\n" . + '
' . "\n"; +} else { - // Show personal addressbook - if($show == 'blank' || !empty($listall)) { + /* Show personal addressbook */ + if ($show == 'blank' || !empty($listall)) { if($backend != -1 || $show == 'blank') { - if($show == 'blank') + if ($show == 'blank') { $backend = $abook->localbackend; - + } $res = $abook->list_addr($backend); if(is_array($res)) { display_result($res, false); } else { - printf("

"._("Unable to list addresses from %s"). - "

\n", $abook->backends[$backend]->sname); + echo '

' . + sprintf(_("Unable to list addresses from %s"), + $abook->backends[$backend]->sname) . + '

' . "\n"; } - } else { - $res = $abook->list_addr(); - display_result($res, true); + $res = $abook->list_addr(); + display_result($res, true); } - } else + } else { - // Do the search - if(!empty($query) && empty($listall)) { + /* Do the search */ + if (!empty($query) && empty($listall)) { - if($backend == -1) { - $res = $abook->s_search($query); - } else { - $res = $abook->s_search($query, $backend); - } + if($backend == -1) { + $res = $abook->s_search($query); + } else { + $res = $abook->s_search($query, $backend); + } - if(!is_array($res)) { - printf("


%s:
%s

\n\n", - _("Your search failed with the following error(s)"), - $abook->error); - exit; - } + if (!is_array($res)) { + echo '


' . + _("Your search failed with the following error(s)") . + ':
' . $abook->error . "

\n\n"; + exit; + } - if(sizeof($res) == 0) { - printf("


%s.

\n\n", - _("No persons matching your search was found")); - exit; - } + if (sizeof($res) == 0) { + echo '


' . + _("No persons matching your search was found") . + ".

\n\n"; + exit; + } - display_result($res); + display_result($res); + } } - echo "\n"; +} + +echo "\n"; ?>