Skip to content

Commit

Permalink
Merge pull request #2 from zero-24/patch-8
Browse files Browse the repository at this point in the history
Let Travis be a happy guy
  • Loading branch information
coolcat-creations committed Sep 24, 2015
2 parents ff5ba55 + e42059a commit b153f2c
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions components/com_contact/views/contact/view.vcf.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,24 @@ public function display($tpl = null)

$rev = date('c', strtotime($item->modified));

JFactory::getApplication()->setHeader('Content-disposition', 'attachment; filename="' . utf8_decode($card_name) . '.vcf"', true);

$vcard = array();
$vcard[].= 'BEGIN:VCARD';
$vcard[].= 'VERSION:3.0';
$vcard[] = 'N:'. utf8_decode($lastname.';'.$firstname.';'.$middlename);
/* Zeichensatz auf UTF-8 geändert -> */
$vcard[] = 'FN:'. utf8_decode($item->name);
$vcard[] = 'TITLE:'. utf8_decode($item->con_position);
/* <- Zeichensatz auf UTF-8 geändert */
$vcard[] = 'TEL;TYPE=WORK,VOICE:'.$item->telephone;
$vcard[] = 'TEL;TYPE=WORK,FAX:'.$item->fax;
$vcard[] = 'TEL;TYPE=WORK,MOBILE:'.$item->mobile;
$vcard[] = 'ADR;TYPE=WORK:;;'. utf8_decode($item->address.';'.$item->suburb.';'.$item->state.';'.$item->postcode.';'.$item->country);
$vcard[] = 'LABEL;TYPE=WORK:'. utf8_decode($item->address."\n".$item->suburb."\n".$item->state."\n".$item->postcode."\n".$item->country);
$vcard[] = 'EMAIL;TYPE=PREF,INTERNET:'.$item->email_to;
$vcard[] = 'URL:'.$item->webpage;
$vcard[] = 'REV:'.$rev.'Z';
$vcard[] = 'END:VCARD';

echo implode("\n", $vcard);
JFactory::getApplication()->setHeader('Content-disposition', 'attachment; filename="' . utf8_decode($card_name) . '.vcf"', true);

$vcard = array();
$vcard[].= 'BEGIN:VCARD';
$vcard[].= 'VERSION:3.0';
$vcard[] = 'N:' . utf8_decode($lastname . ';' . $firstname . ';' . $middlename);
$vcard[] = 'FN:' . utf8_decode($item->name);
$vcard[] = 'TITLE:' . utf8_decode($item->con_position);
$vcard[] = 'TEL;TYPE=WORK,VOICE:' . $item->telephone;
$vcard[] = 'TEL;TYPE=WORK,FAX:' . $item->fax;
$vcard[] = 'TEL;TYPE=WORK,MOBILE:' . $item->mobile;
$vcard[] = 'ADR;TYPE=WORK:;;' . utf8_decode($item->address . ';' . $item->suburb . ';' . $item->state . ';' . $item->postcode . ';' . $item->country);
$vcard[] = 'LABEL;TYPE=WORK:' . utf8_decode($item->address . "\n" . $item->suburb . "\n" . $item->state . "\n" . $item->postcode . "\n" . $item->country);
$vcard[] = 'EMAIL;TYPE=PREF,INTERNET:' . $item->email_to;
$vcard[] = 'URL:' . $item->webpage;
$vcard[] = 'REV:' . $rev . 'Z';
$vcard[] = 'END:VCARD';

echo implode("\n", $vcard);
}
}

0 comments on commit b153f2c

Please sign in to comment.