From d444fa27eb1406b29ea96b18853fe10a0fddecbc Mon Sep 17 00:00:00 2001 From: jervfors Date: Sun, 3 Oct 2004 08:36:03 +0000 Subject: [PATCH] Changing strings to conform with "src/addressbook.php". Added possibility for the user to add an e-mail address if one isn't at the vcard. Added possibility for the user to add extra information if only name and e-mail address is at the vcard. Moving some HTML outside PHP. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8129 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/vcard.php | 102 +++++++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 42 deletions(-) diff --git a/src/vcard.php b/src/vcard.php index 4760c7ef..b3d42b10 100644 --- a/src/vcard.php +++ b/src/vcard.php @@ -20,10 +20,7 @@ Define('SM_PATH','../'); /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/date.php'); -require_once(SM_PATH . 'functions/page_header.php'); require_once(SM_PATH . 'functions/mime.php'); -require_once(SM_PATH . 'include/load_prefs.php'); /* globals */ sqgetGlobalVar('username', $username, SQ_SESSION); @@ -39,13 +36,11 @@ sqgetGlobalVar('startMessage', $startMessage, SQ_GET); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); - displayPageHeader($color, 'None'); echo '
' . "\n" . - ''; +echo ''. _("View message") . '' . + ''; $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); $entity_vcard = getEntity($message,$ent_id); -$vcard = mime_fetch_body ($imapConnection, $passed_id, $ent_id); +$vcard = mime_fetch_body($imapConnection, $passed_id, $ent_id); $vcard = decodeBody($vcard, $entity_vcard->header->encoding); $vcard = explode ("\n",$vcard); foreach ($vcard as $l) { @@ -135,30 +129,47 @@ if (isset($vcard_safe['url'])) { foreach ($ShowValues as $k => $v) { if (isset($vcard_safe[$k]) && $vcard_safe[$k]) { - echo "\n"; + echo "\n"; } } -echo '
' . - '
' . + '
' . _("Viewing a Business Card") . " - "; $msg_url = 'read_body.php?mailbox='.urlencode($mailbox). @@ -54,15 +49,14 @@ $msg_url = 'read_body.php?mailbox='.urlencode($mailbox). $msg_url = set_url_var($msg_url, 'ent_id', 0); -echo ''. _("View message") . ''; - -echo '
$v:" . $vcard_safe[$k] . - "
$v:" . + $vcard_safe[$k] . "
' . - '
' . - '' . - '' . - '' . - '' . - '
' . - '
' . - _("Add to Addressbook") . - '
' . - addForm('../src/addressbook.php', 'post', 'f_add') . - '' . - '' . - '' . - '
' . _("Nickname:") . '' . - addInput('addaddr[nickname]', $vcard_safe['firstname'] . '-' . - $vcard_safe['lastname'], '20') . - '
' . _("Note Field Contains:") . '' ; +?> +
+
+
+ + +
+
+
+
+ + +' . + '' . + ' -
: +
' . _("E-mail address") . ':' . + addInput('addaddr[email]', '', '20'); +} + +echo '
' . _("Additional info") . ':'; $opts = array(); if (isset($vcard_nice['url'])) { @@ -192,18 +203,26 @@ if (isset($vcard_nice['note'])) { $opts[$vcard_nice['note']] = _("Note"); } -echo addSelect('addaddr[label]', $opts, '', TRUE); +/* + * If the vcard comes with nothing but name and e-mail address, the user gets + * the chance to type some additional info. If there's more info in the card, + * the user gets to choose what will be added as additional info. + */ +if (count($opts) == 0) { + echo addInput('addaddr[label]', '', '20'); +} else { + echo addSelect('addaddr[label]', $opts, '', TRUE); +} + ?>
+

@@ -211,13 +230,12 @@ echo addHidden('addaddr[firstname]', $vcard_safe['firstname']).
'. + '&ent_id=' . urlencode($ent_id) . '">' . _("Download this as a file") . ''; ?>
-
-- 2.25.1