ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Profile\VCard Class Reference

RFC 2426 vCard MIME Directory Profile 3.0 class. More...

+ Collaboration diagram for ILIAS\User\Profile\VCard:

Public Member Functions

 __construct (string $version='3.0')
 
 encode (string $string)
 Encode data with 'b' type encoding according to RFC 2045. More...
 
 fold (string $string='')
 Fold a string according to RFC 2425. More...
 
 escape (string $string)
 Escapes a string according to RFC 2426. More...
 
 explodeVar (string $variable, string $separator=',')
 Splits a variable into an array using a separator and escapes every value. More...
 
 buildVCard ()
 Builds a vCard string out of the attributes of this object. More...
 
 quoted_printable_encode (string $input, int $line_max=76)
 Creates a quoted printable encoded string according to RFC 2045. More...
 
 setFormattedName (string $formatted_name)
 Sets the value for the vCard FN type. More...
 
 setName (string $family_name, string $given_name='', string $additional_names='', string $honorific_prefixes='', string $honorific_suffixes='')
 Sets the value for the vCard N type. More...
 
 setNickname (string $nickname)
 Sets the value for the vCard NICKNAME type. More...
 
 setPhoto (string $photo, string $type='')
 Sets the value for the vCard PHOTO type. More...
 
 setBirthday (int $year, int $month, int $day)
 Sets the value for the vCard BDAY type. More...
 
 setAddress (string $po_box='', string $extended_address='', string $street_address='', string $locality='', string $region='', string $postal_code='', string $country='', int $type=self::ADR_TYPE_NONE)
 Sets the value for the vCard ADR type. More...
 
 setLabel (string $label='', int $type=self::ADR_TYPE_NONE)
 Sets the value for the vCard LABEL type. More...
 
 setPhone (string $number='', int $type=self::TEL_TYPE_VOICE)
 Sets the value for the vCard TEL type. More...
 
 setEmail (string $address='', int $type=self::EMAIL_TYPE_INTERNET)
 Sets the value for the vCard EMAIL type. More...
 
 setMailer (string $name='')
 Sets the value for the vCard MAILER type. More...
 
 setTimezone (string $zone='')
 Sets the value for the vCard TZ type. More...
 
 setPosition (string $latitude='', string $longitude='')
 Sets the value for the vCard GEO type. More...
 
 setTitle (string $title='')
 Sets the value for the vCard TITLE type. More...
 
 setRole (string $role='')
 Sets the value for the vCard ROLE type. More...
 
 setLogo (string $logo, string $type='')
 Sets the value for the vCard LOGO type. More...
 
 setAgent (string $agent='')
 Sets the value for the vCard AGENT type. More...
 
 setOrganization (string $organization='')
 Sets the value for the vCard ORG type. More...
 
 setCategories (string $categories)
 Sets the value for the vCard CATEGORIES type. More...
 
 setNote (string $note='')
 Sets the value for the vCard NOTE type. More...
 
 setProductId (string $product_id='')
 Sets the value for the vCard PRODID type. More...
 
 setRevision (string $revision_date='')
 Sets the value for the vCard REV type. More...
 
 setSortString (string $string='')
 Sets the value for the vCard SORT-STRING type. More...
 
 setSound (string $sound='', string $type='')
 Sets the value for the vCard SOUND type. More...
 
 setUID (string $uid='', string $type='')
 Sets the value for the vCard UID type. More...
 
 setURL (string $uri='')
 Sets the value for the vCard URL type. More...
 
 setVersion (string $version='3.0')
 Sets the value for the vCard VERSION type. More...
 
 setClassification (string $classification='')
 Sets the value for the vCard CLASS type. More...
 
 setKey (string $key='', string $type='')
 Sets the value for the vCard KEY type. More...
 
 getFilename ()
 
 getMimetype ()
 

Data Fields

const ADR_TYPE_NONE = 0
 
const ADR_TYPE_DOM = 1
 
const ADR_TYPE_INTL = 2
 
const ADR_TYPE_POSTAL = 4
 
const ADR_TYPE_PARCEL = 8
 
const ADR_TYPE_HOME = 16
 
const ADR_TYPE_WORK = 32
 
const ADR_TYPE_PREF = 64
 
const TEL_TYPE_NONE = 0
 
const TEL_TYPE_HOME = 1
 
const TEL_TYPE_MSG = 2
 
const TEL_TYPE_WORK = 4
 
const TEL_TYPE_PREF = 8
 
const TEL_TYPE_VOICE = 16
 
const TEL_TYPE_FAX = 32
 
const TEL_TYPE_CELL = 64
 
const TEL_TYPE_VIDEO = 128
 
const TEL_TYPE_PAGER = 256
 
const TEL_TYPE_BBS = 512
 
const TEL_TYPE_MODEM = 1024
 
const TEL_TYPE_CAR = 2048
 
const TEL_TYPE_ISDN = 4096
 
const TEL_TYPE_PCS = 8192
 
const EMAIL_TYPE_NONE = 0
 
const EMAIL_TYPE_INTERNET = 1
 
const EMAIL_TYPE_x400 = 2
 
const EMAIL_TYPE_PREF = 4
 
array $types
 
string $filename
 

Detailed Description

RFC 2426 vCard MIME Directory Profile 3.0 class.

Author
Helmut Schottmüller hscho.nosp@m.ttm@.nosp@m.tzi.d.nosp@m.e

Definition at line 27 of file VCard.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\VCard::__construct ( string  $version = '3.0')

Definition at line 71 of file VCard.php.

72 {
73 $this->types = [
74 'FN' => '',
75 'N' => '',
76 'NICKNAME' => '',
77 'PHOTO' => [],
78 'BDAY' => '',
79 'ADR' => [],
80 'LABEL' => [],
81 'TEL' => [],
82 'EMAIL' => [],
83 'MAILER' => '',
84 'TZ' => '',
85 'GEO' => '',
86 'TITLE' => '',
87 'ROLE' => '',
88 'LOGO' => [],
89 'AGENT' => '',
90 'ORG' => '',
91 'CATEGORIES' => '',
92 'NOTE' => '',
93 'PRODID' => '',
94 'REV' => '',
95 'SORT-STRING' => '',
96 'SOUND' => [],
97 'UID' => '',
98 'URL' => '',
99 'CLASS' => '',
100 'KEY' => []
101 ];
102 $this->types['VERSION'] = $version;
103 }
$version
Definition: plugin.php:24

References $version.

Member Function Documentation

◆ buildVCard()

ILIAS\User\Profile\VCard::buildVCard ( )

Builds a vCard string out of the attributes of this object.

Definition at line 160 of file VCard.php.

160 : string
161 {
162 $fn = $n = $nickname = $photo = $bday = $adr = $label = $tel = $email = $mailer =
163 $tz = $geo = $title = $role = $logo = $agent = $org = $categories = $note = $prodid =
164 $rev = $sortstring = $sound = $uid = $url = $class = $key = 0;
165
166 $vcard = "BEGIN:VCARD\n";
167 $vcard .= 'VERSION:' . $this->types['VERSION'] . "\n";
168 foreach ($this->types as $type => $var) {
169 \ilLoggerFactory::getLogger('user')->debug(print_r($this->types, true));
170
171 switch ($type) {
172 case 'FN':
173 if (strcmp($this->types['FN'], '') != 0) {
174 $fn = $this->fold('FN:' . $this->types['FN']) . "\n";
175 } else {
176 $fn = '';
177 }
178 break;
179 case 'N':
180 if (strcmp($this->types['N'], '') != 0) {
181 $n = $this->fold('N:' . $this->types['N']) . "\n";
182 } else {
183 $n = '';
184 }
185 break;
186 case 'NICKNAME':
187 if (strcmp($this->types['NICKNAME'], '') != 0) {
188 $nickname = $this->fold('NICKNAME:' . $this->types['NICKNAME']) . "\n";
189 } else {
190 $nickname = '';
191 }
192 break;
193 case 'PHOTO':
194 $photo = '';
195 if (isset($this->types['PHOTO'])) {
196 if (strcmp(($this->types['PHOTO']['VALUE'] ?? ''), '') != 0) {
197 $photo = $this->fold('PHOTO;VALUE=uri:' . $this->types['PHOTO']['VALUE']) . "\n";
198 } elseif (strcmp(($this->types['PHOTO']['ENCODING'] ?? ''), '') != 0) {
199 $photo = 'PHOTO;ENCODING=' . $this->types['PHOTO']['ENCODING'];
200 if (strcmp($this->types['PHOTO']['TYPE'], '') != 0) {
201 $photo .= ';TYPE=' . $this->types['PHOTO']['TYPE'];
202 }
203 $photo .= ':' . $this->types['PHOTO']['PHOTO'];
204 $photo = $this->fold($photo) . "\n";
205 }
206 }
207 break;
208 case 'BDAY':
209 if (strcmp($this->types['BDAY'], '') != 0) {
210 $bday = $this->fold('BDAY:' . $this->types['BDAY']) . "\n";
211 } else {
212 $bday = '';
213 }
214 break;
215 case 'ADR':
216 if (count($this->types['ADR'])) {
217 $addresses = '';
218 foreach ($this->types['ADR'] as $key => $address) {
219 $test = implode('', $address);
220 if (strcmp($test, '') != 0) {
221 $adr = 'ADR';
222 $adr_types = [];
223 if ($address['TYPE'] > 0) {
224 if (($address['TYPE'] & ADR_TYPE_DOM) > 0) {
225 $adr_types[] = 'dom';
226 }
227 if (($address['TYPE'] & ADR_TYPE_INTL) > 0) {
228 $adr_types[] = 'intl';
229 }
230 if (($address['TYPE'] & ADR_TYPE_POSTAL) > 0) {
231 $adr_types[] = 'postal';
232 }
233 if (($address['TYPE'] & ADR_TYPE_PARCEL) > 0) {
234 $adr_types[] = 'parcel';
235 }
236 if (($address['TYPE'] & ADR_TYPE_HOME) > 0) {
237 $adr_types[] = 'home';
238 }
239 if (($address['TYPE'] & ADR_TYPE_WORK) > 0) {
240 $adr_types[] = 'work';
241 }
242 if (($address['TYPE'] & ADR_TYPE_PREF) > 0) {
243 $adr_types[] = 'pref';
244 }
245 $adr .= ';TYPE=' . implode(',', $adr_types);
246 }
247 $adr .= ':' . $address['POBOX'] . ';' . $address['EXTENDED_ADDRESS'] .
248 ';' . $address['STREET_ADDRESS'] . ';' . $address['LOCALITY'] .
249 ';' . $address['REGION'] . ';' . $address['POSTAL_CODE'] .
250 ';' . $address['COUNTRY'];
251 $adr = $this->fold($adr) . "\n";
252 $addresses .= $adr;
253 }
254 }
255 $adr = $addresses;
256 } else {
257 $adr = '';
258 }
259 break;
260 case 'LABEL':
261 $label = '';
262 if (isset($this->types['LABEL'])) {
263 if (strcmp(($this->types['LABEL']['LABEL'] ?? ''), '') != 0) {
264 $label = 'LABEL';
265 $adr_types = [];
266 if ($this->types['LABEL']['TYPE'] > 0) {
267 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_DOM) > 0) {
268 $adr_types[] = 'dom';
269 }
270 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_INTL) > 0) {
271 $adr_types[] = 'intl';
272 }
273 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_POSTAL) > 0) {
274 $adr_types[] = 'postal';
275 }
276 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_PARCEL) > 0) {
277 $adr_types[] = 'parcel';
278 }
279 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_HOME) > 0) {
280 $adr_types[] = 'home';
281 }
282 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_WORK) > 0) {
283 $adr_types[] = 'work';
284 }
285 if (($this->types['LABEL']['TYPE'] & self::ADR_TYPE_PREF) > 0) {
286 $adr_types[] = 'pref';
287 }
288 $label .= ';TYPE=' . implode(',', $adr_types);
289 }
290 $label .= ':' . $this->types['LABEL']['LABEL'];
291 $label = $this->fold($label) . "\n";
292 }
293 }
294 break;
295 case 'TEL':
296 if (count($this->types['TEL'])) {
297 $phonenumbers = '';
298 foreach ($this->types['TEL'] as $key => $phone) {
299 if (strcmp($phone['TEL'], '') != 0) {
300 $tel = 'TEL';
301 $tel_types = [];
302 if ($phone['TYPE'] > 0) {
303 if (($phone['TYPE'] & self::TEL_TYPE_HOME) > 0) {
304 $tel_types[] = 'home';
305 }
306 if (($phone['TYPE'] & self::TEL_TYPE_MSG) > 0) {
307 $tel_types[] = 'msg';
308 }
309 if (($phone['TYPE'] & self::TEL_TYPE_WORK) > 0) {
310 $tel_types[] = 'work';
311 }
312 if (($phone['TYPE'] & self::TEL_TYPE_PREF) > 0) {
313 $tel_types[] = 'pref';
314 }
315 if (($phone['TYPE'] & self::TEL_TYPE_VOICE) > 0) {
316 $tel_types[] = 'voice';
317 }
318 if (($phone['TYPE'] & self::TEL_TYPE_FAX) > 0) {
319 $tel_types[] = 'fax';
320 }
321 if (($phone['TYPE'] & self::TEL_TYPE_CELL) > 0) {
322 $tel_types[] = 'cell';
323 }
324 if (($phone['TYPE'] & self::TEL_TYPE_VIDEO) > 0) {
325 $tel_types[] = 'video';
326 }
327 if (($phone['TYPE'] & self::TEL_TYPE_PAGER) > 0) {
328 $tel_types[] = 'pager';
329 }
330 if (($phone['TYPE'] & self::TEL_TYPE_BBS) > 0) {
331 $tel_types[] = 'bbs';
332 }
333 if (($phone['TYPE'] & self::TEL_TYPE_MODEM) > 0) {
334 $tel_types[] = 'modem';
335 }
336 if (($phone['TYPE'] & self::TEL_TYPE_CAR) > 0) {
337 $tel_types[] = 'car';
338 }
339 if (($phone['TYPE'] & self::TEL_TYPE_ISDN) > 0) {
340 $tel_types[] = 'isdn';
341 }
342 if (($phone['TYPE'] & self::TEL_TYPE_PCS) > 0) {
343 $tel_types[] = 'pcs';
344 }
345 $tel .= ';TYPE=' . implode(',', $tel_types);
346 }
347 $tel .= ':' . $phone['TEL'];
348 $tel = $this->fold($tel) . "\n";
349 $phonenumbers .= $tel;
350 }
351 }
352 $tel = $phonenumbers;
353 } else {
354 $tel = '';
355 }
356 break;
357 case 'EMAIL':
358 if (count($this->types['EMAIL'])) {
359 $emails = '';
360 foreach ($this->types['EMAIL'] as $key => $mail) {
361 if (strcmp($mail['EMAIL'], '') != 0) {
362 $email = 'EMAIL';
363 $adr_types = [];
364 if ($mail['TYPE'] > 0) {
365 if (($mail['TYPE'] & self::EMAIL_TYPE_INTERNET) > 0) {
366 $adr_types[] = 'internet';
367 }
368 if (($mail['TYPE'] & self::EMAIL_TYPE_x400) > 0) {
369 $adr_types[] = 'x400';
370 }
371 if (($mail['TYPE'] & self::EMAIL_TYPE_PREF) > 0) {
372 $adr_types[] = 'pref';
373 }
374 $email .= ';TYPE=' . implode(',', $adr_types);
375 }
376 $email .= ':' . $mail['EMAIL'];
377 $email = $this->fold($email) . "\n";
378 $emails .= $email;
379 }
380 }
381 $email = $emails;
382 } else {
383 $email = '';
384 }
385 break;
386 case 'MAILER':
387 if (strcmp(($this->types['MAILER'] ?? ''), '') != 0) {
388 $mailer = $this->fold('MAILER:' . $this->types['MAILER']) . "\n";
389 } else {
390 $mailer = '';
391 }
392 break;
393 case 'TZ':
394 if (strcmp(($this->types['TZ'] ?? ''), '') != 0) {
395 $tz = $this->fold('TZ:' . $this->types['TZ']) . "\n";
396 } else {
397 $tz = '';
398 }
399 break;
400 case 'GEO':
401 if (isset($this->types['GEO']) and
402 (strcmp(($this->types['GEO']['LAT'] ?? ''), '') != 0) and
403 (strcmp(($this->types['GEO']['LON'] ?? ''), '') != 0)) {
404 $geo = $this->fold(
405 'GEO:' . $this->types['GEO']['LAT'] . ';' . $this->types['GEO']['LON']
406 ) . "\n";
407 } else {
408 $geo = '';
409 }
410 break;
411 case 'TITLE':
412 if (strcmp(($this->types['TITLE'] ?? ''), '') != 0) {
413 $title = $this->fold('TITLE:' . $this->types['TITLE']) . "\n";
414 } else {
415 $title = '';
416 }
417 break;
418 case 'ROLE':
419 if (strcmp(($this->types['ROLE'] ?? ''), '') != 0) {
420 $role = $this->fold('ROLE:' . $this->types['ROLE']) . "\n";
421 } else {
422 $role = '';
423 }
424 break;
425 case 'LOGO':
426 $logo = '';
427 if (isset($this->types['LOGO'])) {
428 if (strcmp(($this->types['LOGO']['VALUE'] ?? ''), '') != 0) {
429 $logo = $this->fold('LOGO;VALUE=uri:' . $this->types['LOGO']['VALUE']) . "\n";
430 } elseif (strcmp(($this->types['LOGO']['ENCODING'] ?? ''), '') != 0) {
431 $logo = 'LOGO;ENCODING=' . $this->types['LOGO']['ENCODING'];
432 if (strcmp($this->types['LOGO']['TYPE'], '') != 0) {
433 $logo .= ';TYPE=' . $this->types['LOGO']['TYPE'];
434 }
435 $logo .= ':' . $this->types['LOGO']['LOGO'];
436 $logo = $this->fold($logo) . "\n";
437 }
438 }
439 break;
440 case 'AGENT':
441 if (strcmp(($this->types['AGENT'] ?? ''), '') != 0) {
442 $agent = $this->fold('AGENT:' . $this->types['AGENT']) . "\n";
443 } else {
444 $agent = '';
445 }
446 break;
447 case 'ORG':
448 if (strcmp(($this->types['ORG'] ?? ''), '') != 0) {
449 $org = $this->fold('ORG:' . $this->types['ORG']) . "\n";
450 } else {
451 $org = '';
452 }
453 break;
454 case 'CATEGORIES':
455 if (strcmp(($this->types['CATEGORIES'] ?? ''), '') != 0) {
456 $categories = $this->fold('CATEGORIES:' . $this->types['CATEGORIES']) . "\n";
457 } else {
458 $categories = '';
459 }
460 break;
461 case 'NOTE':
462 if (strcmp(($this->types['NOTE'] ?? ''), '') != 0) {
463 $note = $this->fold('NOTE:' . $this->types['NOTE']) . "\n";
464 } else {
465 $note = '';
466 }
467 break;
468 case 'PRODID':
469 if (strcmp(($this->types['PRODID'] ?? ''), '') != 0) {
470 $prodid = $this->fold('PRODID:' . $this->types['PRODID']) . "\n";
471 } else {
472 $prodid = '';
473 }
474 break;
475 case 'REV':
476 if (strcmp(($this->types['REV'] ?? ''), '') != 0) {
477 $rev = $this->fold('REV:' . $this->types['REV']) . "\n";
478 } else {
479 $rev = '';
480 }
481 break;
482 case 'SORT-STRING':
483 if (strcmp(($this->types['SORT-STRING'] ?? ''), '') != 0) {
484 $sortstring = $this->fold('SORT-STRING:' . $this->types['SORT-STRING']) . "\n";
485 } else {
486 $sortstring = '';
487 }
488 break;
489 case 'SOUND':
490 $sound = '';
491 if (isset($this->types['SOUND'])) {
492 if (strcmp(($this->types['SOUND']['VALUE'] ?? ''), '') != 0) {
493 $sound = $this->fold('SOUND;VALUE=uri:' . $this->types['SOUND']['VALUE']) . "\n";
494 } elseif (strcmp(($this->types['SOUND']['ENCODING'] ?? ''), '') != 0) {
495 $sound = 'SOUND;ENCODING=' . $this->types['SOUND']['ENCODING'];
496 if (strcmp($this->types['SOUND']['TYPE'], '') != 0) {
497 $sound .= ';TYPE=' . $this->types['SOUND']['TYPE'];
498 }
499 $sound .= ':' . $this->types['SOUND']['SOUND'];
500 $sound = $this->fold($sound) . "\n";
501 }
502 }
503 break;
504 case 'UID':
505 $uid = '';
506 if (isset($this->types['UID'])) {
507 if (strcmp(($this->types['UID']['UID'] ?? ''), '') != 0) {
508 $uid = 'UID';
509 if (strcmp($this->types['UID']['TYPE'], '') != 0) {
510 $uid .= ';TYPE=' . $this->types['UID']['TYPE'];
511 }
512 $uid .= ':' . $this->types['UID']['UID'];
513 $uid = $this->fold($uid) . "\n";
514 }
515 }
516 break;
517 case 'URL':
518 if (strcmp(($this->types['URL'] ?? ''), '') != 0) {
519 $url = $this->fold('URL:' . $this->types['URL']) . "\n";
520 } else {
521 $url = '';
522 }
523 break;
524 case 'KEY':
525 $key = '';
526 if (isset($this->types['KEY'])) {
527 if (strcmp(($this->types['KEY']['KEY'] ?? ''), '') != 0) {
528 $key = 'KEY';
529 if (strcmp($this->types['KEY']['TYPE'], '') != 0) {
530 $key .= ';TYPE=' . $this->types['KEY']['TYPE'];
531 }
532 if (strcmp($this->types['KEY']['ENCODING'], '') != 0) {
533 $key .= ';ENCODING=' . $this->types['KEY']['ENCODING'];
534 }
535 $key .= ':' . $this->types['KEY']['KEY'];
536 $key = $this->fold($key) . "\n";
537 }
538 }
539 break;
540 case 'CLASS':
541 if (strcmp(($this->types['CLASS'] ?? ''), '') != 0) {
542 $class = $this->fold('CLASS:' . $this->types['CLASS']) . "\n";
543 } else {
544 $class = '';
545 }
546 break;
547 }
548 }
549 $vcard .= $fn . $n . $nickname . $photo . $bday . $adr . $label . $tel . $email . $mailer .
550 $tz . $geo . $title . $role . $logo . $agent . $org . $categories . $note . $prodid .
551 $rev . $sortstring . $sound . $uid . $url . $class . $key;
552 $vcard .= "END:vCard\n";
553 return $vcard;
554 }
fold(string $string='')
Fold a string according to RFC 2425.
Definition: VCard.php:116
static getLogger(string $a_component_id)
Get component logger.
$url
Definition: shib_logout.php:68

References $url, ILIAS\User\Profile\VCard\ADR_TYPE_DOM, ILIAS\User\Profile\VCard\ADR_TYPE_HOME, ILIAS\User\Profile\VCard\ADR_TYPE_INTL, ILIAS\User\Profile\VCard\ADR_TYPE_PARCEL, ILIAS\User\Profile\VCard\ADR_TYPE_POSTAL, ILIAS\User\Profile\VCard\ADR_TYPE_PREF, ILIAS\User\Profile\VCard\ADR_TYPE_WORK, ILIAS\User\Profile\VCard\fold(), and ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

◆ encode()

ILIAS\User\Profile\VCard::encode ( string  $string)

Encode data with 'b' type encoding according to RFC 2045.

Definition at line 108 of file VCard.php.

108 : string
109 {
110 return $this->escape(quoted_printable_encode($string));
111 }
escape(string $string)
Escapes a string according to RFC 2426.
Definition: VCard.php:135
quoted_printable_encode(string $input, int $line_max=76)
Creates a quoted printable encoded string according to RFC 2045.
Definition: VCard.php:559

References ILIAS\User\Profile\VCard\escape(), and ILIAS\User\Profile\VCard\quoted_printable_encode().

+ Here is the call graph for this function:

◆ escape()

ILIAS\User\Profile\VCard::escape ( string  $string)

Escapes a string according to RFC 2426.

Definition at line 135 of file VCard.php.

135 : string
136 {
137 $string = preg_replace('/(?<!\\\\)(\\\\)([^;,n\\\\])/', '\${1}\${1}\${2}', $string);
138 $string = preg_replace('/(?<!\\\\);/', '\\;', $string);
139 $string = preg_replace('/(?<!\\\\),/', '\\,', $string);
140 $string = preg_replace('/\n/', '\\n', $string);
141 return $string;
142 }

Referenced by ILIAS\User\Profile\VCard\encode(), ILIAS\User\Profile\VCard\explodeVar(), and ILIAS\User\Profile\VCard\setFormattedName().

+ Here is the caller graph for this function:

◆ explodeVar()

ILIAS\User\Profile\VCard::explodeVar ( string  $variable,
string  $separator = ',' 
)

Splits a variable into an array using a separator and escapes every value.

Returns
array<string,string>

Definition at line 148 of file VCard.php.

148 : array
149 {
150 $exploded = explode($separator, $variable);
151 foreach ($exploded as $index => $var) {
152 $exploded[$index] = $this->escape($var);
153 }
154 return $exploded;
155 }

References ILIAS\User\Profile\VCard\escape().

+ Here is the call graph for this function:

◆ fold()

ILIAS\User\Profile\VCard::fold ( string  $string = '')

Fold a string according to RFC 2425.

Definition at line 116 of file VCard.php.

116 : string
117 {
118 $folded_string = '';
119 preg_match_all('/(.{1,74})/', $string, $matches);
120 for ($i = 0, $iMax = count($matches[1]); $i < $iMax; $i++) {
121 if ($i < (count($matches[1]) - 1)) {
122 $matches[1][$i] .= "\n";
123 }
124 if ($i > 0) {
125 $matches[1][$i] = ' ' . $matches[1][$i];
126 }
127 $folded_string .= $matches[1][$i];
128 }
129 return $folded_string;
130 }

Referenced by ILIAS\User\Profile\VCard\buildVCard().

+ Here is the caller graph for this function:

◆ getFilename()

ILIAS\User\Profile\VCard::getFilename ( )

Definition at line 1445 of file VCard.php.

1445 : string
1446 {
1447 if (strcmp($this->filename, '') == 0) {
1448 return 'vcard.vcf';
1449 } else {
1450 return $this->filename;
1451 }
1452 }

References $filename.

◆ getMimetype()

ILIAS\User\Profile\VCard::getMimetype ( )

Definition at line 1454 of file VCard.php.

1454 : string
1455 {
1456 return 'text/x-vcard';
1457 }

◆ quoted_printable_encode()

ILIAS\User\Profile\VCard::quoted_printable_encode ( string  $input,
int  $line_max = 76 
)

Creates a quoted printable encoded string according to RFC 2045.

Definition at line 559 of file VCard.php.

559 : string
560 {
561 $hex = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
562 $lines = preg_split('/(\r\n|\r|\n)/', $input);
563 $eol = "\r\n";
564 $linebreak = '=0D=0A';
565 $escape = '=';
566 $output = '';
567
568 for ($j = 0, $jMax = count($lines); $j < $jMax; $j++) {
569 $line = $lines[$j];
570 $linlen = strlen($line);
571 $newline = '';
572 for ($i = 0; $i < $linlen; $i++) {
573 $c = substr($line, $i, 1);
574 $dec = ord($c);
575 if (($dec == 32) && ($i == ($linlen - 1))) { // convert space at eol only
576 $c = '=20';
577 } elseif (($dec == 61) || ($dec < 32) || ($dec > 126)) { // always encode '\t', which is *not* required
578 $h2 = floor($dec / 16);
579 $h1 = floor($dec % 16);
580 $c = $escape . $hex[(string) $h2] . $hex[(string) $h1];
581 }
582 if ((strlen($newline) + strlen($c)) >= $line_max) { // CRLF is not counted
583 $output .= $newline . $escape . $eol; // soft line break; ' =\r\n' is okay
584 $newline = ' ';
585 }
586 $newline .= $c;
587 } // end of for
588 $output .= $newline;
589 if ($j < count($lines) - 1) {
590 $output .= $linebreak;
591 }
592 }
593 return trim($output);
594 }
$c
Definition: deliver.php:25

References $c.

Referenced by ILIAS\User\Profile\VCard\encode().

+ Here is the caller graph for this function:

◆ setAddress()

ILIAS\User\Profile\VCard::setAddress ( string  $po_box = '',
string  $extended_address = '',
string  $street_address = '',
string  $locality = '',
string  $region = '',
string  $postal_code = '',
string  $country = '',
int  $type = self::ADR_TYPE_NONE 
)

Sets the value for the vCard ADR type.

Sets the value for the vCard ADR type to specify the components of the delivery address for the vCard object. Type example: ADR;TYPE=dom,home,postal,parcel:;;123 Main Street;Any Town;CA;91921-1234 Type special notes: The structured type value consists of a sequence of address components. The component values MUST be specified in their corresponding position. The structured type value corresponds, in sequence, to the post office box; the extended address; the street address; the locality (e.g., city); the region (e.g., state or province); the postal code; the country name. When a component value is missing, the associated component separator MUST still be specified. The text components are separated by the SEMI-COLON character (ASCII decimal 59). Where it makes semantic sense, individual text components can include multiple text values (e.g., a 'street' component with multiple lines) separated by the COMMA character (ASCII decimal 44). The type can include the type parameter 'TYPE' to specify the delivery address type. The TYPE parameter values can include 'dom' to indicate a domestic delivery address; 'intl' to indicate an international delivery address; 'postal' to indicate a postal delivery address; 'parcel' to indicate a parcel delivery address; 'home' to indicate a delivery address for a residence; 'work' to indicate delivery address for a place of work; and 'pref' to indicate the preferred delivery address when more than one address is specified. These type parameter values can be specified as a parameter list (i.e., 'TYPE=dom;TYPE=postal') or as a value list (i.e., 'TYPE=dom,postal'). This type is based on semantics of the X.520 geographical and postal addressing attributes. The default is 'TYPE=intl,postal,parcel,work'. The default can be overridden to some other set of values by specifying one or more alternate values. For example, the default can be reset to 'TYPE=dom,postal,work,home' to specify a domestic delivery address for postal delivery to a residence that is also used for work.

Parameters
string$po_boxPost office box
string$extended_addressExtended address
string$street_addressStreet address
string$localityLocality (e.g. city)
string$regionRegion (e.g. state or province)
string$postal_codePostal code
string$countryCountry
int$typeThe address type (can be combined with the + operator) @access public

Definition at line 807 of file VCard.php.

816 : void {
817 if ($type === self::ADR_TYPE_NONE) {
818 $type = self::ADR_TYPE_INTL + self::ADR_TYPE_POSTAL + self::ADR_TYPE_PARCEL + self::ADR_TYPE_WORK;
819 }
820 $po_box = implode(',', $this->explodeVar($po_box));
821 $extended_address = implode(',', $this->explodeVar($extended_address));
822 $street_address = implode(',', $this->explodeVar($street_address));
823 $locality = implode(',', $this->explodeVar($locality));
824 $region = implode(',', $this->explodeVar($region));
825 $postal_code = implode(',', $this->explodeVar($postal_code));
826 $country = implode(',', $this->explodeVar($country));
827 $this->types['ADR'][] = [
828 'POBOX' => $po_box,
829 'EXTENDED_ADDRESS' => $extended_address,
830 'STREET_ADDRESS' => $street_address,
831 'LOCALITY' => $locality,
832 'REGION' => $region,
833 'POSTAL_CODE' => $postal_code,
834 'COUNTRY' => $country,
835 'TYPE' => $type
836 ];
837 }
explodeVar(string $variable, string $separator=',')
Splits a variable into an array using a separator and escapes every value.
Definition: VCard.php:148

◆ setAgent()

ILIAS\User\Profile\VCard::setAgent ( string  $agent = '')

Sets the value for the vCard AGENT type.

Sets the value for the vCard AGENT type to specify information about another person who will act on behalf of the individual or resource associated with the vCard. Type example: AGENT;VALUE=uri: CID:JQPUB.nosp@m.LIC..nosp@m.part3.nosp@m..960.nosp@m.129T0.nosp@m.8302.nosp@m.0.xyz.nosp@m.Mail.nosp@m.@host.nosp@m.3.co.nosp@m.m AGENT:BEGIN:VCARD\nFN:Susan Thomas\nTEL:+1-919-555- 1234\nEMAIL\;INTERNET:sthom.nosp@m.as@h.nosp@m.ost.c.nosp@m.om\nEND:VCARD
Type value: The default is a single vcard value. It can also be reset to either a single text or uri value. The text value can be used to specify textual information. The uri value can be used to specify information outside of this MIME entity. Type special notes: This type typically is used to specify an area administrator, assistant, or secretary for the individual associated with the vCard. A key characteristic of the Agent type is that it represents somebody or something that is separately addressable.

Parameters
string$agentAgent type

Definition at line 1137 of file VCard.php.

1137 : void
1138 {
1139 $this->types['AGENT'] = $this->escape($agent);
1140 }

◆ setBirthday()

ILIAS\User\Profile\VCard::setBirthday ( int  $year,
int  $month,
int  $day 
)

Sets the value for the vCard BDAY type.

Sets the value for the vCard BDAY type to specify the birth date of the object the vCard represents. Type example: BDAY:1996-04-15 BDAY:1953-10-15T23:10:00Z BDAY:1987-09-27T08:30:00-06:00 Type value: The default is a single date value. It can also be reset to a single date-time value.

Parameters
int$yearThe year of the birthday
int$monthThe month of the birthday
int$dayThe day of the birthday

Definition at line 747 of file VCard.php.

747 : void
748 {
749 if (($year < 1) or ($day < 1) or ($month < 1)) {
750 $this->types['BDAY'] = '';
751 } else {
752 $this->types['BDAY'] = sprintf('%04d-%02d-%02d', $year, $month, $day);
753 }
754 }

◆ setCategories()

ILIAS\User\Profile\VCard::setCategories ( string  $categories)

Sets the value for the vCard CATEGORIES type.

Sets the value for the vCard CATEGORIES type to specify application category information about the vCard. Type example: CATEGORIES:TRAVEL AGENT CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY Type value: One or more text values separated by a COMMA character (ASCII decimal 44). @access public

Definition at line 1177 of file VCard.php.

1177 : void
1178 {
1179 $categories = implode(',', $this->explodeVar($categories));
1180 $this->types['CATEGORIES'] = $categories;
1181 }

◆ setClassification()

ILIAS\User\Profile\VCard::setClassification ( string  $classification = '')

Sets the value for the vCard CLASS type.

Sets the value for the vCard CLASS type to specify the access classification for a vCard object. Type example: CLASS:PUBLIC CLASS:PRIVATE CLASS:CONFIDENTIAL Type value: A single text value. Type special notes: An access classification is only one component of the general security model for a directory service. The classification attribute provides a method of capturing the intent of the owner for general access to information described by the vCard object.

Parameters
string$classificationClassification string

Definition at line 1393 of file VCard.php.

1393 : void
1394 {
1395 $this->types['CLASS'] = $this->escape($classification);
1396 }
$classification

References $classification.

◆ setEmail()

ILIAS\User\Profile\VCard::setEmail ( string  $address = '',
int  $type = self::EMAIL_TYPE_INTERNET 
)

Sets the value for the vCard EMAIL type.

Sets the value for the vCard EMAIL type to specify the electronic mail address for communication with the object the vCard represents. Type example: EMAIL;TYPE=internet:jqpub.nosp@m.lic@.nosp@m.xyz.d.nosp@m.om1..nosp@m.com EMAIL;TYPE=internet:jdoe@.nosp@m.isp..nosp@m.net EMAIL;TYPE=internet,pref:jane_.nosp@m.doe@.nosp@m.abc.c.nosp@m.om Type special notes: The type can include the type parameter 'TYPE' to specify the format or preference of the electronic mail address. The TYPE parameter values can include: 'internet' to indicate an Internet addressing type, 'x400' to indicate a X.400 addressing type or 'pref' to indicate a preferred-use email address when more than one is specified. Another IANA registered address type can also be specified. The default email type is 'internet'. A non-standard value can also be specified.

Parameters
string$addressThe email address
int$typeThe address type (can be combined with the + operator)

Definition at line 951 of file VCard.php.

954 : void {
955 $this->types['EMAIL'][] = [
956 'EMAIL' => $this->escape($address),
957 'TYPE' => $type
958 ];
959 }

◆ setFormattedName()

ILIAS\User\Profile\VCard::setFormattedName ( string  $formatted_name)

Sets the value for the vCard FN type.

Sets the value for the vCard FN type to specify the formatted text corresponding to the name of the object the vCard represents. Type example: FN:Mr. John Q. Public\, Esq.

Definition at line 609 of file VCard.php.

609 : void
610 {
611 $this->types['FN'] = $this->escape($formatted_name);
612 }

References ILIAS\User\Profile\VCard\escape().

+ Here is the call graph for this function:

◆ setKey()

ILIAS\User\Profile\VCard::setKey ( string  $key = '',
string  $type = '' 
)

Sets the value for the vCard KEY type.

Sets the value for the vCard KEY type to specify a public key or authentication certificate associated with the object that the vCard represents. Type example: KEY;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0 ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2 dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau +hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7 UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ== Type encoding: The encoding MUST be reset to 'b' using the ENCODING parameter in order to specify inline, encoded binary data. If the value is a text value, then the default encoding of 8bit is used and no explicit ENCODING parameter is needed. Type value: A single value. The default is binary. It can also be reset to text value. The text value can be used to specify a text key. Type special notes: The type can also include the type parameter TYPE to specify the public key or authentication certificate format. The parameter type should specify an IANA registered public key or authentication certificate format. The parameter type can also specify a non-standard format.

Parameters
string$keyPublic key
string$typeIANA registered public key or authentication certificate format

Definition at line 1434 of file VCard.php.

1434 : void
1435 {
1436 $encoding = 'b';
1437 $key = base64_encode($key);
1438 $this->types['KEY'] = [
1439 'KEY' => $key,
1440 'TYPE' => $type,
1441 'ENCODING' => $encoding
1442 ];
1443 }

◆ setLabel()

ILIAS\User\Profile\VCard::setLabel ( string  $label = '',
int  $type = self::ADR_TYPE_NONE 
)

Sets the value for the vCard LABEL type.

Sets the value for the vCard LABEL type to specify the formatted text corresponding to delivery address of the object the vCard represents Type example: A multi-line address label. LABEL;TYPE=dom,home,postal,parcel:Mr.John Q. Public\, Esq.
Mail Drop: TNE QB\n123 Main Street\nAny Town\, CA 91921-1234 \nU.S.A. Type special notes: The type value is formatted text that can be used to present a delivery address label for the vCard object. The type can include the type parameter 'TYPE' to specify delivery label type. The TYPE parameter values can include 'dom' to indicate a domestic delivery label; 'intl' to indicate an international delivery label; 'postal' to indicate a postal delivery label; 'parcel' to indicate a parcel delivery label; 'home' to indicate a delivery label for a residence; 'work' to indicate delivery label for a place of work; and 'pref' to indicate the preferred delivery label when more than one label is specified. These type parameter values can be specified as a parameter list (i.e., 'TYPE=dom;TYPE=postal') or as a value list (i.e., 'TYPE=dom,postal'). This type is based on semantics of the X.520 geographical and postal addressing attributes. The default is 'TYPE=intl,postal,parcel,work'. The default can be overridden to some other set of values by specifying one or more alternate values. For example, the default can be reset to 'TYPE=intl,post,parcel,home' to specify an international delivery label for both postal and parcel delivery to a residential location.

Parameters
string$labelThe address label
int$typeThe address type (can be combined with the + operator)

Definition at line 869 of file VCard.php.

872 : void {
873 if ($type == self::ADR_TYPE_NONE) {
874 $type = self::ADR_TYPE_INTL + self::ADR_TYPE_POSTAL + self::ADR_TYPE_PARCEL + self::ADR_TYPE_WORK;
875 }
876 $this->types['LABEL'] = [
877 'LABEL' => $this->escape($label),
878 'TYPE' => $type
879 ];
880 }

◆ setLogo()

ILIAS\User\Profile\VCard::setLogo ( string  $logo,
string  $type = '' 
)

Sets the value for the vCard LOGO type.

Sets the value for the vCard LOGO type to specify a graphic image of a logo associated with the object the vCard represents. Type example: LOGO;VALUE=uri:http://www.abc.com/pub/logos/abccorp.jpg LOGO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0 <...the remainder of 'B' encoded binary data...> Type encoding: The encoding MUST be reset to 'b' using the ENCODING parameter in order to specify inline, encoded binary data. If the value is referenced by a URI value, then the default encoding of 8bit is used and no explicit ENCODING parameter is needed. Type value: A single value. The default is binary value. It can also be reset to uri value. The uri value can be used to specify a value outside of this MIME entity. Type special notes: The type can include the type parameter 'TYPE' to specify the graphic image format type. The TYPE parameter values MUST be one of the IANA registered image formats or a non-standard image format.

Parameters
string$logoA binary string containing the logo or an uri
string$typeThe IANA type of the image format

Definition at line 1099 of file VCard.php.

1099 : void
1100 {
1101 $value = '';
1102 $encoding = '';
1103 if (preg_match('/^http/', $logo)) {
1104 $value = $this->encode($logo);
1105 } else {
1106 $encoding = 'b';
1107 $logo = base64_encode($logo);
1108 }
1109 $this->types['LOGO'] = [
1110 'VALUE' => $value,
1111 'TYPE' => $type,
1112 'ENCODING' => $encoding,
1113 'LOGO' => $logo
1114 ];
1115 }
encode(string $string)
Encode data with 'b' type encoding according to RFC 2045.
Definition: VCard.php:108

◆ setMailer()

ILIAS\User\Profile\VCard::setMailer ( string  $name = '')

Sets the value for the vCard MAILER type.

Sets the value for the vCard MAILER type to specify the type of electronic mail software that is used by the individual associated with the vCard. Type example: MAILER:PigeonMail 2.1 Type special notes: This information can provide assistance to a correspondent regarding the type of data representation which can be used, and how they can be packaged. This property is based on the private MIME type X-Mailer that is generally implemented by MIME user agent products.

Parameters
string$nameThe mailer name

Definition at line 975 of file VCard.php.

975 : void
976 {
977 $this->types['MAILER'] = $this->escape($name);
978 }

◆ setName()

ILIAS\User\Profile\VCard::setName ( string  $family_name,
string  $given_name = '',
string  $additional_names = '',
string  $honorific_prefixes = '',
string  $honorific_suffixes = '' 
)

Sets the value for the vCard N type.

Sets the value for the vCard N type to specify the components of the name of the object the vCard represents. The N type MUST be present in the vCard object. Type example: N:Public;John;Quinlan;Mr.;Esq. N:Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P. Type special note: The structured type value corresponds, in sequence, to the Family Name, Given Name, Additional Names, Honorific Prefixes, and Honorific Suffixes. The text components are separated by the SEMI-COLON character (ASCII decimal 59). Individual text components can include multiple text values (e.g., multiple Additional Names) separated by the COMMA character (ASCII decimal 44). This type is based on the semantics of the X.520 individual name attributes. The property MUST be present in the vCard object.

Parameters
string$family_nameThe family name
string$given_nameThe given name
string$additional_namesAdditional names
string$honorific_prefixesHonorific prefixes
string$honorific_suffixesHonorific suffixes

Definition at line 636 of file VCard.php.

642 : void {
643 $familynames = $this->explodeVar($family_name);
644 $givennames = $this->explodeVar($given_name);
645 $addnames = $this->explodeVar($additional_names);
646 $prefixes = $this->explodeVar($honorific_prefixes);
647 $suffixes = $this->explodeVar($honorific_suffixes);
648
649 $this->types['N'] =
650 implode(',', $familynames) .
651 ';' .
652 implode(',', $givennames) .
653 ';' .
654 implode(',', $addnames) .
655 ';' .
656 implode(',', $prefixes) .
657 ';' .
658 implode(',', $suffixes);
659
660 $this->filename = $given_name . '_' . $family_name . '.vcf';
661 if (strcmp($this->types['FN'], '') === 0) {
662 $fn = trim("$honorific_prefixes $given_name $additional_names $family_name $honorific_suffixes");
663 $fn = preg_replace('/\s{2,10}/', ' ', $fn);
664 $this->setFormattedName($fn);
665 }
666 }
setFormattedName(string $formatted_name)
Sets the value for the vCard FN type.
Definition: VCard.php:609

◆ setNickname()

ILIAS\User\Profile\VCard::setNickname ( string  $nickname)

Sets the value for the vCard NICKNAME type.

Sets the value for the vCard NICKNAME type to specify the text corresponding to the nickname of the object the vCard represents. Type example: NICKNAME:Robbie NICKNAME:Jim,Jimmie Type special note: The nickname is the descriptive name given instead of or in addition to the one belonging to a person, place, or thing. It can also be used to specify a familiar form of a proper name specified by the FN or N types.

Definition at line 681 of file VCard.php.

681 : void
682 {
683 $nicknames = $this->explodeVar($nickname);
684 $this->types['NICKNAME'] = implode(',', $nicknames);
685 }

◆ setNote()

ILIAS\User\Profile\VCard::setNote ( string  $note = '')

Sets the value for the vCard NOTE type.

Sets the value for the vCard NOTE type to specify supplemental information or a comment that is associated with the vCard. Type example: NOTE:This fax number is operational 0800 to 1715 EST\, Mon-Fri. Type value: A single text value. Type special notes: The type is based on the X.520 Description attribute.

Parameters
string$noteA note or comment

Definition at line 1195 of file VCard.php.

1195 : void
1196 {
1197 $this->types['NOTE'] = $this->escape($note);
1198 }

◆ setOrganization()

ILIAS\User\Profile\VCard::setOrganization ( string  $organization = '')

Sets the value for the vCard ORG type.

Sets the value for the vCard ORG type to specify the organizational name and units associated with the vCard. Type example: ORG:ABC\, Inc.;North American Division;Marketing Type value: A single structured text value consisting of components separated the SEMI-COLON character (ASCII decimal 59). Type special notes: The type is based on the X.520 Organization Name and Organization Unit attributes. The type value is a structured type consisting of the organization name, followed by one or more levels of organizational unit names.

Parameters
string$organizationOrganization description

Definition at line 1156 of file VCard.php.

1156 : void
1157 {
1158 $organization = implode(';', $this->explodeVar($organization, ';'));
1159 $this->types['ORG'] = $organization;
1160 }

◆ setPhone()

ILIAS\User\Profile\VCard::setPhone ( string  $number = '',
int  $type = self::TEL_TYPE_VOICE 
)

Sets the value for the vCard TEL type.

Sets the value for the vCard TEL type to specify the telephone number for telephony communication with the object the vCard represents. Type example: TEL;TYPE=work,voice,pref,msg:+1-213-555-1234 Type special notes: The value of this type is specified in a canonical form in order to specify an unambiguous representation of the globally unique telephone endpoint. This type is based on the X.500 Telephone Number attribute. The type can include the type parameter 'TYPE' to specify intended use for the telephone number. The TYPE parameter values can include: 'home' to indicate a telephone number associated with a residence, 'msg' to indicate the telephone number has voice messaging support, 'work' to indicate a telephone number associated with a place of vwork, 'pref' to indicate a preferred-use telephone number, 'voice' to indicate a voice telephone number, 'fax' to indicate a facsimile telephone number, 'cell' to indicate a cellular telephone number, 'video' to indicate a video conferencing telephone number, 'pager' to indicate a paging device telephone number, 'bbs' to indicate a bulletin board system telephone number, 'modem' to indicate a MODEM connected telephone number, 'car' to indicate a car-phone telephone number, 'isdn' to indicate an ISDN service telephone number, 'pcs' to indicate a personal communication services telephone number. The default type is 'voice'. These type parameter values can be specified as a parameter list (i.e., 'TYPE=work;TYPE=voice') or as a value list (i.e., 'TYPE=work,voice'). The default can be overridden to another set of values by specifying one or more alternate values. For example, the default TYPE of 'voice' can be reset to a WORK and HOME, VOICE and FAX telephone number by the value list 'TYPE=work,home,voice,fax'.

Parameters
string$numberThe phone number
int$typeThe address type (can be combined with the + operator)

Definition at line 921 of file VCard.php.

924 : void {
925 $this->types['TEL'][] = [
926 'TEL' => $this->escape($number),
927 'TYPE' => $type
928 ];
929 }

◆ setPhoto()

ILIAS\User\Profile\VCard::setPhoto ( string  $photo,
string  $type = '' 
)

Sets the value for the vCard PHOTO type.

Sets the value for the vCard PHOTO type to specify an image or photograph information that annotates some aspect of the object the vCard represents. Type example: PHOTO;VALUE=uri:http://www.abc.com/pub/photos /jqpublic.gif PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0 <...remainder of 'B' encoded binary data...> Type encoding: The encoding MUST be reset to 'b' using the ENCODING parameter in order to specify inline, encoded binary data. If the value is referenced by a URI value, then the default encoding of 8bit is used and no explicit ENCODING parameter is needed. Type value: A single value. The default is binary value. It can also be reset to uri value. The uri value can be used to specify a value outside of this MIME entity. Type special notes: The type can include the type parameter 'TYPE' to specify the graphic image format type. The TYPE parameter values MUST be one of the IANA registered image formats or a non-standard image format.

Parameters
string$photoA binary string containing the photo or an uri
string$typeThe IANA type of the image format

Definition at line 713 of file VCard.php.

716 : void {
717 $value = '';
718 $encoding = '';
719 if (preg_match('/^http/', $photo)) {
720 $value = $this->encode($photo);
721 } else {
722 $encoding = 'b';
723 $photo = base64_encode($photo);
724 }
725 $this->types['PHOTO'] = [
726 'VALUE' => $value,
727 'TYPE' => $type,
728 'ENCODING' => $encoding,
729 'PHOTO' => $photo
730 ];
731 }

◆ setPosition()

ILIAS\User\Profile\VCard::setPosition ( string  $latitude = '',
string  $longitude = '' 
)

Sets the value for the vCard GEO type.

Sets the value for the vCard GEO type to specify information related to the global positioning of the object the vCard represents. Type example: GEO:37.386013;-122.082932 Type value: A single structured value consisting of two float values separated by the SEMI-COLON character (ASCII decimal 59). Type special notes: This type specifies information related to the global position of the object associated with the vCard. The value specifies latitude and longitude, in that order (i.e., 'LAT LON' ordering). The longitude represents the location east and west of the prime meridian as a positive or negative real number, respectively. The latitude represents the location north and south of the equator as a positive or negative real number, respectively. The longitude and latitude values MUST be specified as decimal degrees and should be specified to six decimal places. This will allow for granularity within a meter of the geographical position. The text components are separated by the SEMI-COLON character (ASCII decimal 59). The simple formula for converting degrees-minutes-seconds into decimal degrees is: decimal = degrees + minutes/60 + seconds/3600.

Parameters
string$latitudeThe latitude of the position
string$longitudeThe longitude of the position

Definition at line 1027 of file VCard.php.

1027 : void
1028 {
1029 $this->types['GEO'] = [
1030 'LAT' => $latitude,
1031 'LON' => $longitude
1032 ];
1033 }

◆ setProductId()

ILIAS\User\Profile\VCard::setProductId ( string  $product_id = '')

Sets the value for the vCard PRODID type.

Sets the value for the vCard PRODID type to specify the identifier for the product that created the vCard object. Type example: PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN Type value: A single text value. Type special notes: Implementations SHOULD use a method such as that specified for Formal Public Identifiers in ISO 9070 to assure that the text value is unique.

Parameters
string$product_idProduct identifier

Definition at line 1212 of file VCard.php.

1212 : void
1213 {
1214 $this->types['PRODID'] = $this->escape($product_id);
1215 }

◆ setRevision()

ILIAS\User\Profile\VCard::setRevision ( string  $revision_date = '')

Sets the value for the vCard REV type.

Sets the value for the vCard REV type to specify revision information about the current vCard. Type example: REV:1995-10-31T22:27:10Z REV:1997-11-15 Type value: The default is a single date-time value. Can also be reset to a single date value. Type special notes: The value distinguishes the current revision of the information in this vCard for other renditions of the information.

Parameters
string$revision_dateRevision date

Definition at line 1231 of file VCard.php.

1231 : void
1232 {
1233 $this->types['REV'] = $this->escape($revision_date);
1234 }

◆ setRole()

ILIAS\User\Profile\VCard::setRole ( string  $role = '')

Sets the value for the vCard ROLE type.

Sets the value for the vCard ROLE type to specify information concerning the role, occupation, or business category of the object the vCard represents. Type example: ROLE:Programmer Type special notes: This type is based on the X.520 Business Category explanatory attribute. This property is included as an organizational type to avoid confusion with the semantics of the TITLE type and incorrect usage of that type when the semantics of this type is intended.

Parameters
string$roleRole title

Definition at line 1069 of file VCard.php.

1069 : void
1070 {
1071 $this->types['ROLE'] = $this->escape($role);
1072 }

◆ setSortString()

ILIAS\User\Profile\VCard::setSortString ( string  $string = '')

Sets the value for the vCard SORT-STRING type.

Sets the value for the vCard SORT-STRING type to specify the family name or given name text to be used for national-language-specific sorting of the FN and N types. Type examples: For the case of family name sorting, the following examples define common sort string usage with the FN and N types. FN:Rene van der Harten N:van der Harten;Rene;J.;Sir;R.D.O.N. SORT-STRING:Harten FN:Robert Pau Shou Chang N:Pau;Shou Chang;Robert SORT-STRING:Pau FN:Osamu Koura N:Koura;Osamu SORT-STRING:Koura FN:Oscar del Pozo N:del Pozo Triscon;Oscar SORT-STRING:Pozo FN:Chistine d'Aboville N:d'Aboville;Christine SORT-STRING:Aboville Type value: A single text value. Type special notes: The sort string is used to provide family name or given name text that is to be used in locale- or national-language- specific sorting of the formatted name and structured name types. Without this information, sorting algorithms could incorrectly sort this vCard within a sequence of sorted vCards. When this type is present in a vCard, then this family name or given name value is used for sorting the vCard.

Parameters
string$stringSort string

Definition at line 1268 of file VCard.php.

1268 : void
1269 {
1270 $this->types['SORT-STRING'] = $this->escape($string);
1271 }

◆ setSound()

ILIAS\User\Profile\VCard::setSound ( string  $sound = '',
string  $type = '' 
)

Sets the value for the vCard SOUND type.

Sets the value for the vCard SOUND type to specify a digital sound content information that annotates some aspect of the vCard. By default this type is used to specify the proper pronunciation of the name type value of the vCard. Type example: SOUND;TYPE=BASIC;VALUE=uri:CID:JOHNQPUBLIC.part8. 19960.nosp@m.229T.nosp@m.08000.nosp@m.0.xy.nosp@m.zMail.nosp@m.@hos.nosp@m.t1.co.nosp@m.m SOUND;TYPE=BASIC;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0 <...the remainder of 'B' encoded binary data...> Type encoding: The encoding MUST be reset to 'b' using the ENCODING parameter in order to specify inline, encoded binary data. If the value is referenced by a URI value, then the default encoding of 8bit is used and no explicit ENCODING parameter is needed. Type value: A single value. The default is binary value. It can also be reset to uri value. The uri value can be used to specify a value outside of this MIME entity. Type special notes: The type can include the type parameter 'TYPE' to specify the audio format type. The TYPE parameter values MUST be one of the IANA registered audio formats or a non-standard audio format.

Parameters
string$soundBinary string containing the sound
string$typeThe IANA registered sound type

Definition at line 1299 of file VCard.php.

1299 : void
1300 {
1301 $value = '';
1302 $encoding = '';
1303 if (preg_match('/^http/', $sound)) {
1304 $value = $this->encode($sound);
1305 } else {
1306 $encoding = 'b';
1307 $sound = base64_encode($sound);
1308 }
1309 $this->types['SOUND'] = [
1310 'VALUE' => $value,
1311 'TYPE' => $type,
1312 'ENCODING' => $encoding,
1313 'SOUND' => $sound
1314 ];
1315 }

◆ setTimezone()

ILIAS\User\Profile\VCard::setTimezone ( string  $zone = '')

Sets the value for the vCard TZ type.

Sets the value for the vCard TZ type to specify information related to the time zone of the object the vCard represents. Type example: TZ:-05:00 TZ;VALUE=text:-05:00; EST; Raleigh/North America Type special notes: The type value consists of a single value.

Parameters
string$zoneThe timezone as utc-offset value

Definition at line 996 of file VCard.php.

996 : void
997 {
998 $this->types['TZ'] = $this->escape($zone);
999 }

◆ setTitle()

ILIAS\User\Profile\VCard::setTitle ( string  $title = '')

Sets the value for the vCard TITLE type.

Sets the value for the vCard TITLE type to specify the job title, functional position or function of the object the vCard represents. Type example: TITLE:Director\, Research and Development Type special notes: This type is based on the X.520 Title attribute.

Parameters
string$titleJob title

Definition at line 1050 of file VCard.php.

1050 : void
1051 {
1052 $this->types['TITLE'] = $this->escape($title);
1053 }

◆ setUID()

ILIAS\User\Profile\VCard::setUID ( string  $uid = '',
string  $type = '' 
)

Sets the value for the vCard UID type.

Sets the value for the vCard UID type to specify a value that represents a globally unique identifier corresponding to the individual or resource associated with the vCard. Type example: UID:19950401-080045-40000F192713-0052 Type value: A single text value. Type special notes: The type is used to uniquely identify the object that the vCard represents. The type can include the type parameter 'TYPE' to specify the format of the identifier. The TYPE parameter value should be an IANA registered identifier format. The value can also be a non-standard format.

Parameters
string$uidGlobally unique identifier
string$typeIANA registered identifier format

Definition at line 1335 of file VCard.php.

1335 : void
1336 {
1337 $this->types['UID'] = [
1338 'UID' => $this->escape($uid),
1339 'TYPE' => $type
1340 ];
1341 }

◆ setURL()

ILIAS\User\Profile\VCard::setURL ( string  $uri = '')

Sets the value for the vCard URL type.

Sets the value for the vCard URL type to specify a uniform resource locator associated with the object that the vCard refers to. Type example: URL:http://www.ilias.de/index.html Type value: A single text value.

Parameters
string$uriURL

Definition at line 1353 of file VCard.php.

1353 : void
1354 {
1355 $this->types['URL'] = $this->escape($uri);
1356 }

◆ setVersion()

ILIAS\User\Profile\VCard::setVersion ( string  $version = '3.0')

Sets the value for the vCard VERSION type.

Sets the value for the vCard VERSION type to specify the version of the vCard specification used Type example: VERSION:3.0 Type special notes: The property MUST be present in the vCard object. The value MUST be '3.0' if the vCard corresponds to the vCard 3.0 specification.

Parameters
string$versionVersion string

Definition at line 1368 of file VCard.php.

1368 : void
1369 {
1370 $this->types['VERSION'] = $version;
1371 }

References $version.

Field Documentation

◆ $filename

string ILIAS\User\Profile\VCard::$filename

Definition at line 69 of file VCard.php.

◆ $types

array ILIAS\User\Profile\VCard::$types

Definition at line 66 of file VCard.php.

◆ ADR_TYPE_DOM

const ILIAS\User\Profile\VCard::ADR_TYPE_DOM = 1

Definition at line 31 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ ADR_TYPE_HOME

const ILIAS\User\Profile\VCard::ADR_TYPE_HOME = 16

Definition at line 35 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ ADR_TYPE_INTL

const ILIAS\User\Profile\VCard::ADR_TYPE_INTL = 2

Definition at line 32 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ ADR_TYPE_NONE

const ILIAS\User\Profile\VCard::ADR_TYPE_NONE = 0

Definition at line 30 of file VCard.php.

◆ ADR_TYPE_PARCEL

const ILIAS\User\Profile\VCard::ADR_TYPE_PARCEL = 8

Definition at line 34 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ ADR_TYPE_POSTAL

const ILIAS\User\Profile\VCard::ADR_TYPE_POSTAL = 4

Definition at line 33 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ ADR_TYPE_PREF

const ILIAS\User\Profile\VCard::ADR_TYPE_PREF = 64

Definition at line 37 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ ADR_TYPE_WORK

const ILIAS\User\Profile\VCard::ADR_TYPE_WORK = 32

Definition at line 36 of file VCard.php.

Referenced by ILIAS\User\Profile\VCard\buildVCard().

◆ EMAIL_TYPE_INTERNET

const ILIAS\User\Profile\VCard::EMAIL_TYPE_INTERNET = 1

Definition at line 58 of file VCard.php.

◆ EMAIL_TYPE_NONE

const ILIAS\User\Profile\VCard::EMAIL_TYPE_NONE = 0

Definition at line 57 of file VCard.php.

◆ EMAIL_TYPE_PREF

const ILIAS\User\Profile\VCard::EMAIL_TYPE_PREF = 4

Definition at line 60 of file VCard.php.

◆ EMAIL_TYPE_x400

const ILIAS\User\Profile\VCard::EMAIL_TYPE_x400 = 2

Definition at line 59 of file VCard.php.

◆ TEL_TYPE_BBS

const ILIAS\User\Profile\VCard::TEL_TYPE_BBS = 512

Definition at line 50 of file VCard.php.

◆ TEL_TYPE_CAR

const ILIAS\User\Profile\VCard::TEL_TYPE_CAR = 2048

Definition at line 52 of file VCard.php.

◆ TEL_TYPE_CELL

const ILIAS\User\Profile\VCard::TEL_TYPE_CELL = 64

Definition at line 47 of file VCard.php.

Referenced by ILIAS\User\Profile\PublicProfileGUI\deliverVCard().

◆ TEL_TYPE_FAX

const ILIAS\User\Profile\VCard::TEL_TYPE_FAX = 32

Definition at line 46 of file VCard.php.

Referenced by ILIAS\User\Profile\PublicProfileGUI\deliverVCard().

◆ TEL_TYPE_HOME

const ILIAS\User\Profile\VCard::TEL_TYPE_HOME = 1

Definition at line 41 of file VCard.php.

Referenced by ILIAS\User\Profile\PublicProfileGUI\deliverVCard().

◆ TEL_TYPE_ISDN

const ILIAS\User\Profile\VCard::TEL_TYPE_ISDN = 4096

Definition at line 53 of file VCard.php.

◆ TEL_TYPE_MODEM

const ILIAS\User\Profile\VCard::TEL_TYPE_MODEM = 1024

Definition at line 51 of file VCard.php.

◆ TEL_TYPE_MSG

const ILIAS\User\Profile\VCard::TEL_TYPE_MSG = 2

Definition at line 42 of file VCard.php.

◆ TEL_TYPE_NONE

const ILIAS\User\Profile\VCard::TEL_TYPE_NONE = 0

Definition at line 40 of file VCard.php.

◆ TEL_TYPE_PAGER

const ILIAS\User\Profile\VCard::TEL_TYPE_PAGER = 256

Definition at line 49 of file VCard.php.

◆ TEL_TYPE_PCS

const ILIAS\User\Profile\VCard::TEL_TYPE_PCS = 8192

Definition at line 54 of file VCard.php.

◆ TEL_TYPE_PREF

const ILIAS\User\Profile\VCard::TEL_TYPE_PREF = 8

Definition at line 44 of file VCard.php.

◆ TEL_TYPE_VIDEO

const ILIAS\User\Profile\VCard::TEL_TYPE_VIDEO = 128

Definition at line 48 of file VCard.php.

◆ TEL_TYPE_VOICE

const ILIAS\User\Profile\VCard::TEL_TYPE_VOICE = 16

Definition at line 45 of file VCard.php.

◆ TEL_TYPE_WORK

const ILIAS\User\Profile\VCard::TEL_TYPE_WORK = 4

Definition at line 43 of file VCard.php.

Referenced by ILIAS\User\Profile\PublicProfileGUI\deliverVCard().


The documentation for this class was generated from the following file: