Skip to content

Commit

Permalink
Merge pull request #3088 from mbabker/33256
Browse files Browse the repository at this point in the history
[#33256] downloaded vcard is empty
  • Loading branch information
Michael Babker committed Feb 21, 2014
2 parents 4701bee + 833bbc7 commit 032b785
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/com_contact/views/contact/view.vcf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ class ContactViewContact extends JViewLegacy

protected $item;

public function display()
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
// Get model data.
$item = $this->get('Item');
Expand Down Expand Up @@ -67,7 +74,7 @@ public function display()

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

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

$vcard = array();
$vcard[] .= 'BEGIN:VCARD';
Expand All @@ -86,6 +93,5 @@ public function display()
$vcard[] = 'END:VCARD';

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

0 comments on commit 032b785

Please sign in to comment.