| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/administrator/components/com_contact/helpers/ |
Upload File : |
<?php
/**
* @version $Id: vcard.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @subpackage Contact
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('bitfolge.vcard');
/**
* Class needed to extend vcard class and to correct minor errors
*
* @pacakge Joomla
* @subpackage Contacts
*/
class JvCard extends vCard
{
// needed to fix bug in vcard class
function setName( $family='', $first='', $additional='', $prefix='', $suffix='' ) {
$this->properties["N"] = "$family;$first;$additional;$prefix;$suffix";
$this->setFormattedName( trim( "$prefix $first $additional $family $suffix" ) );
}
// needed to fix bug in vcard class
function setAddress( $postoffice='', $extended='', $street='', $city='', $region='', $zip='', $country='', $type='HOME;POSTAL' ) {
// $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
$separator = ';';
$key = 'ADR';
if ( $type != '' ) {
$key .= $separator . $type;
}
$key.= ';ENCODING=QUOTED-PRINTABLE';
$return = encode( $postoffice );
$return .= $separator . encode( $extended );
$return .= $separator . encode( $street );
$return .= $separator . encode( $city );
$return .= $separator . encode( $region);
$return .= $separator . encode( $zip );
$return .= $separator . encode( $country );
$this->properties[$key] = $return;
}
// added ability to set filename
function setFilename( $filename ) {
$this->filename = $filename .'.vcf';
}
// added ability to set position/title
function setTitle( $title ) {
$title = trim( $title );
$this->properties['TITLE'] = $title;
}
// added ability to set organisation/company
function setOrg( $org ) {
$org = trim( $org );
$this->properties['ORG'] = $org;
}
function getVCard( $sitename ) {
$text = 'BEGIN:VCARD';
$text .= "\r\n";
$text .= 'VERSION:2.1';
$text .= "\r\n";
foreach( $this->properties as $key => $value ) {
$text .= "$key:$value";
$text .= "\r\n";
}
$text .= 'REV:'. date( 'Y-m-d' ) .'T'. date( 'H:i:s' ). 'Z';
$text .= "\r\n";
$text .= 'MAILER: Joomla! vCard for '. $sitename;
$text .= "\r\n";
$text .= 'END:VCARD';
$text .= "\r\n";
return $text;
}
}