X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=templates%2Futil_addressbook.php;h=5ff5f420240ddc77792632d2ddd65e353f714078;hp=49d05df6e94ca554c6d81c3f55c8f2c229f068d8;hb=79af43f54786fd065b376c2a774fc8c9d454e1cb;hpb=eb8c2341659e0ffce3968482344e6a3d7200faac;ds=sidebyside diff --git a/templates/util_addressbook.php b/templates/util_addressbook.php index 49d05df6..5ff5f420 100644 --- a/templates/util_addressbook.php +++ b/templates/util_addressbook.php @@ -11,52 +11,7 @@ * @subpackage templates */ -/** - * Display a column header with sort buttons - * - * @param string $field which field to display - * @author Steve Brown - * @since 1.5.2 - */ -function addAbookSort ($field) { - global $abook_sort_order; - - switch ($field) { - case 'nickname': - $str = _("Nickname"); - $alt = _("sort by nickname"); - $down = 0; - $up = 1; - $has_sort = true; - break; - case 'fullname': - $str = _("Name"); - $alt = _("sort by name"); - $down = 2; - $up = 3; - $has_sort = true; - break; - case 'email': - $str = _("E-mail"); - $alt = _("sort by email"); - $down = 4; - $up = 5; - $has_sort = true; - break; - case 'info': - $str = _("Info"); - $alt = _("sort by info"); - $down = 6; - $up = 7; - $has_sort = true; - break; - default: - return 'BAD SORT FIELD GIVEN: "'.$field.'"'; - } - - return $str . ($has_sort ? show_abook_sort_button($abook_sort_order, $alt, $down, $up) : ''); -} - +//FIXME: the functions in this file should be reviewed and moved to functions/template/abook_util.php and this file should be removed /** * Create a link to compose an email to the email address given. * @@ -66,7 +21,7 @@ function addAbookSort ($field) { */ function composeLink ($row) { return makeComposeLink('src/compose.php?send_to=' . - rawurlencode($row['FullAddress']), + rawurlencode($row['RawFullAddress']), htmlspecialchars($row['Email'])); } @@ -86,16 +41,17 @@ function formatAddressList ($addresses) { $contacts = array(); while(list($undef,$row) = each($addresses)) { $contact = array ( - 'FirstName' => htmlspecialchars($row['firstname']), - 'LastName' => htmlspecialchars($row['lastname']), - 'FullName' => htmlspecialchars($row['name']), - 'NickName' => htmlspecialchars($row['nickname']), - 'Email' => htmlspecialchars($row['email']), - 'FullAddress' => htmlspecialchars(AddressBook::full_address($row)), - 'Info' => htmlspecialchars($row['label']), - 'Extra' => (isset($row['extra']) ? $row['extra'] : NULL), - 'Source' => htmlspecialchars($row['source']), - 'JSEmail' => htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES), + 'FirstName' => htmlspecialchars($row['firstname']), + 'LastName' => htmlspecialchars($row['lastname']), + 'FullName' => htmlspecialchars($row['name']), + 'NickName' => htmlspecialchars($row['nickname']), + 'Email' => htmlspecialchars($row['email']), + 'FullAddress' => htmlspecialchars(AddressBook::full_address($row)), + 'RawFullAddress' => AddressBook::full_address($row), + 'Info' => htmlspecialchars($row['label']), + 'Extra' => (isset($row['extra']) ? $row['extra'] : NULL), + 'Source' => htmlspecialchars($row['source']), + 'JSEmail' => htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES), ); $contacts[] = $contact; }