ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilvCard Class Reference
+ Collaboration diagram for ilvCard:

Public Member Functions

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

Data Fields

 $types
 An array containing the vCard types. More...
 
 $filename
 The filename of the vCard used when saving the vCard. More...
 

Detailed Description

Definition at line 77 of file class.ilvCard.php.

Constructor & Destructor Documentation

◆ __construct()

ilvCard::__construct (   $version = "3.0")

ilvCard Constructor

public

Definition at line 98 of file class.ilvCard.php.

References $version, and array.

99  {
100  $this->types = array(
101  "FN" => "",
102  "N" => "",
103  "NICKNAME" => "",
104  "PHOTO" => array(),
105  "BDAY" => "",
106  "ADR" => array(),
107  "LABEL" => array(),
108  "TEL" => array(),
109  "EMAIL" => array(),
110  "MAILER" => "",
111  "TZ" => "",
112  "GEO" => "",
113  "TITLE" => "",
114  "ROLE" => "",
115  "LOGO" => array(),
116  "AGENT" => "",
117  "ORG" => "",
118  "CATEGORIES" => "",
119  "NOTE" => "",
120  "PRODID" => "",
121  "REV" => "",
122  "SORT-STRING" => "",
123  "SOUND" => array(),
124  "UID" => "",
125  "URL" => "",
126  "VERSION" => "3.0",
127  "CLASS" => "",
128  "KEY" => array()
129  );
130  $this->types["VERSION"] = $version;
131  }
Create styles array
The data for the language used.

Member Function Documentation

◆ buildVCard()

ilvCard::buildVCard ( )

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

Builds a vCard string out of the attributes of this object

Returns
string vCard string public

Definition at line 218 of file class.ilvCard.php.

References $email, $key, $n, $test, $title, $type, $tz, $url, ADR_TYPE_DOM, ADR_TYPE_HOME, ADR_TYPE_INTL, ADR_TYPE_PARCEL, ADR_TYPE_POSTAL, ADR_TYPE_PREF, ADR_TYPE_WORK, array, EMAIL_TYPE_INTERNET, EMAIL_TYPE_PREF, EMAIL_TYPE_x400, fold(), ilLoggerFactory\getLogger(), TEL_TYPE_BBS, TEL_TYPE_CAR, TEL_TYPE_CELL, TEL_TYPE_FAX, TEL_TYPE_HOME, TEL_TYPE_ISDN, TEL_TYPE_MODEM, TEL_TYPE_MSG, TEL_TYPE_PAGER, TEL_TYPE_PCS, TEL_TYPE_PREF, TEL_TYPE_VIDEO, TEL_TYPE_VOICE, and TEL_TYPE_WORK.

219  {
220  $vcard = "BEGIN:VCARD\n";
221  $vcard .= "VERSION:" . $this->types["VERSION"] . "\n";
222  foreach ($this->types as $type => $var) {
223  ilLoggerFactory::getLogger('user')->debug(print_r($this->types, true));
224 
225  switch ($type) {
226  case "FN":
227  if (strcmp($this->types["FN"], "") != 0) {
228  $fn = $this->fold("FN:" . $this->types["FN"]) . "\n";
229  } else {
230  $fn = "";
231  }
232  break;
233  case "N":
234  if (strcmp($this->types["N"], "") != 0) {
235  $n = $this->fold("N:" . $this->types["N"]) . "\n";
236  } else {
237  $n = "";
238  }
239  break;
240  case "NICKNAME":
241  if (strcmp($this->types["NICKNAME"], "") != 0) {
242  $nickname = $this->fold("NICKNAME:" . $this->types["NICKNAME"]) . "\n";
243  } else {
244  $nickname = "";
245  }
246  break;
247  case "PHOTO":
248  $photo = "";
249  if (is_array($this->types["PHOTO"])) {
250  if (strcmp($this->types["PHOTO"]["VALUE"], "") != 0) {
251  $photo = $this->fold("PHOTO;VALUE=uri:" . $this->types["PHOTO"]["VALUE"]) . "\n";
252  } elseif (strcmp($this->types["PHOTO"]["ENCODING"], "") != 0) {
253  $photo = "PHOTO;ENCODING=" . $this->types["PHOTO"]["ENCODING"];
254  if (strcmp($this->types["PHOTO"]["TYPE"], "") != 0) {
255  $photo .= ";TYPE=" . $this->types["PHOTO"]["TYPE"];
256  }
257  $photo .= ":" . $this->types["PHOTO"]["PHOTO"];
258  $photo = $this->fold($photo) . "\n";
259  }
260  }
261  break;
262  case "BDAY":
263  if (strcmp($this->types["BDAY"], "") != 0) {
264  $bday = $this->fold("BDAY:" . $this->types["BDAY"]) . "\n";
265  } else {
266  $bday = "";
267  }
268  break;
269  case "ADR":
270  if (count($this->types["ADR"])) {
271  $addresses = "";
272  foreach ($this->types["ADR"] as $key => $address) {
273  $test = "";
274  foreach ($address as $str) {
275  $test .= $str;
276  }
277  if (strcmp($test, "") != 0) {
278  $adr = "ADR";
279  $adr_types = array();
280  if ($address["TYPE"] > 0) {
281  if (($address["TYPE"] & ADR_TYPE_DOM) > 0) {
282  array_push($adr_types, "dom");
283  }
284  if (($address["TYPE"] & ADR_TYPE_INTL) > 0) {
285  array_push($adr_types, "intl");
286  }
287  if (($address["TYPE"] & ADR_TYPE_POSTAL) > 0) {
288  array_push($adr_types, "postal");
289  }
290  if (($address["TYPE"] & ADR_TYPE_PARCEL) > 0) {
291  array_push($adr_types, "parcel");
292  }
293  if (($address["TYPE"] & ADR_TYPE_HOME) > 0) {
294  array_push($adr_types, "home");
295  }
296  if (($address["TYPE"] & ADR_TYPE_WORK) > 0) {
297  array_push($adr_types, "work");
298  }
299  if (($address["TYPE"] & ADR_TYPE_PREF) > 0) {
300  array_push($adr_types, "pref");
301  }
302  $adr .= ";TYPE=" . join(",", $adr_types);
303  }
304  $adr .= ":" . $address["POBOX"] . ";" . $address["EXTENDED_ADDRESS"] .
305  ";" . $address["STREET_ADDRESS"] . ";" . $address["LOCALITY"] .
306  ";" . $address["REGION"] . ";" . $address["POSTAL_CODE"] .
307  ";" . $address["COUNTRY"];
308  $adr = $this->fold($adr) . "\n";
309  $addresses .= $adr;
310  }
311  }
312  $adr = $addresses;
313  } else {
314  $adr = "";
315  }
316  break;
317  case "LABEL":
318  $label = "";
319  if (is_array($this->types["LABEL"])) {
320  if (strcmp($this->types["LABEL"]["LABEL"], "") != 0) {
321  $label = "LABEL";
322  $adr_types = array();
323  if ($this->types["LABEL"]["TYPE"] > 0) {
324  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_DOM) > 0) {
325  array_push($adr_types, "dom");
326  }
327  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_INTL) > 0) {
328  array_push($adr_types, "intl");
329  }
330  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_POSTAL) > 0) {
331  array_push($adr_types, "postal");
332  }
333  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_PARCEL) > 0) {
334  array_push($adr_types, "parcel");
335  }
336  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_HOME) > 0) {
337  array_push($adr_types, "home");
338  }
339  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_WORK) > 0) {
340  array_push($adr_types, "work");
341  }
342  if (($this->types["LABEL"]["TYPE"] & ADR_TYPE_PREF) > 0) {
343  array_push($adr_types, "pref");
344  }
345  $label .= ";TYPE=" . join(",", $adr_types);
346  }
347  $label .= ":" . $this->types["LABEL"]["LABEL"];
348  $label = $this->fold($label) . "\n";
349  }
350  }
351  break;
352  case "TEL":
353  if (count($this->types["TEL"])) {
354  $phonenumbers = "";
355  foreach ($this->types["TEL"] as $key => $phone) {
356  if (strcmp($phone["TEL"], "") != 0) {
357  $tel = "TEL";
358  $tel_types = array();
359  if ($phone["TYPE"] > 0) {
360  if (($phone["TYPE"] & TEL_TYPE_HOME) > 0) {
361  array_push($tel_types, "home");
362  }
363  if (($phone["TYPE"] & TEL_TYPE_MSG) > 0) {
364  array_push($tel_types, "msg");
365  }
366  if (($phone["TYPE"] & TEL_TYPE_WORK) > 0) {
367  array_push($tel_types, "work");
368  }
369  if (($phone["TYPE"] & TEL_TYPE_PREF) > 0) {
370  array_push($tel_types, "pref");
371  }
372  if (($phone["TYPE"] & TEL_TYPE_VOICE) > 0) {
373  array_push($tel_types, "voice");
374  }
375  if (($phone["TYPE"] & TEL_TYPE_FAX) > 0) {
376  array_push($tel_types, "fax");
377  }
378  if (($phone["TYPE"] & TEL_TYPE_CELL) > 0) {
379  array_push($tel_types, "cell");
380  }
381  if (($phone["TYPE"] & TEL_TYPE_VIDEO) > 0) {
382  array_push($tel_types, "video");
383  }
384  if (($phone["TYPE"] & TEL_TYPE_PAGER) > 0) {
385  array_push($tel_types, "pager");
386  }
387  if (($phone["TYPE"] & TEL_TYPE_BBS) > 0) {
388  array_push($tel_types, "bbs");
389  }
390  if (($phone["TYPE"] & TEL_TYPE_MODEM) > 0) {
391  array_push($tel_types, "modem");
392  }
393  if (($phone["TYPE"] & TEL_TYPE_CAR) > 0) {
394  array_push($tel_types, "car");
395  }
396  if (($phone["TYPE"] & TEL_TYPE_ISDN) > 0) {
397  array_push($tel_types, "isdn");
398  }
399  if (($phone["TYPE"] & TEL_TYPE_PCS) > 0) {
400  array_push($tel_types, "pcs");
401  }
402  $tel .= ";TYPE=" . join(",", $tel_types);
403  }
404  $tel .= ":" . $phone["TEL"];
405  $tel = $this->fold($tel) . "\n";
406  $phonenumbers .= $tel;
407  }
408  }
409  $tel = $phonenumbers;
410  } else {
411  $tel = "";
412  }
413  break;
414  case "EMAIL":
415  if (count($this->types["EMAIL"])) {
416  $emails = "";
417  foreach ($this->types["EMAIL"] as $key => $mail) {
418  if (strcmp($mail["EMAIL"], "") != 0) {
419  $email = "EMAIL";
420  $adr_types = array();
421  if ($mail["TYPE"] > 0) {
422  if (($mail["TYPE"] & EMAIL_TYPE_INTERNET) > 0) {
423  array_push($adr_types, "internet");
424  }
425  if (($mail["TYPE"] & EMAIL_TYPE_x400) > 0) {
426  array_push($adr_types, "x400");
427  }
428  if (($mail["TYPE"] & EMAIL_TYPE_PREF) > 0) {
429  array_push($adr_types, "pref");
430  }
431  $email .= ";TYPE=" . join(",", $adr_types);
432  }
433  $email .= ":" . $mail["EMAIL"];
434  $email = $this->fold($email) . "\n";
435  $emails .= $email;
436  }
437  }
438  $email = $emails;
439  } else {
440  $email = "";
441  }
442  break;
443  case "MAILER":
444  if (strcmp($this->types["MAILER"], "") != 0) {
445  $mailer = $this->fold("MAILER:" . $this->types["MAILER"]) . "\n";
446  } else {
447  $mailer = "";
448  }
449  break;
450  case "TZ":
451  if (strcmp($this->types["TZ"], "") != 0) {
452  $tz = $this->fold("TZ:" . $this->types["TZ"]) . "\n";
453  } else {
454  $tz = "";
455  }
456  break;
457  case "GEO":
458  if (is_array($this->types["GEO"]) and
459  (strcmp($this->types["GEO"]["LAT"], "") != 0) and
460  (strcmp($this->types["GEO"]["LON"], "") != 0)) {
461  $geo = $this->fold("GEO:" . $this->types["GEO"]["LAT"] . ";" . $this->types["GEO"]["LON"]) . "\n";
462  } else {
463  $geo = "";
464  }
465  break;
466  case "TITLE":
467  if (strcmp($this->types["TITLE"], "") != 0) {
468  $title = $this->fold("TITLE:" . $this->types["TITLE"]) . "\n";
469  } else {
470  $title = "";
471  }
472  break;
473  case "ROLE":
474  if (strcmp($this->types["ROLE"], "") != 0) {
475  $role = $this->fold("ROLE:" . $this->types["ROLE"]) . "\n";
476  } else {
477  $role = "";
478  }
479  break;
480  case "LOGO":
481  $logo = "";
482  if (is_array($this->types["LOGO"])) {
483  if (strcmp($this->types["LOGO"]["VALUE"], "") != 0) {
484  $logo = $this->fold("LOGO;VALUE=uri:" . $this->types["LOGO"]["VALUE"]) . "\n";
485  } elseif (strcmp($this->types["LOGO"]["ENCODING"], "") != 0) {
486  $logo = "LOGO;ENCODING=" . $this->types["LOGO"]["ENCODING"];
487  if (strcmp($this->types["LOGO"]["TYPE"], "") != 0) {
488  $logo .= ";TYPE=" . $this->types["LOGO"]["TYPE"];
489  }
490  $logo .= ":" . $this->types["LOGO"]["LOGO"];
491  $logo = $this->fold($logo) . "\n";
492  }
493  }
494  break;
495  case "AGENT":
496  if (strcmp($this->types["AGENT"], "") != 0) {
497  $agent = $this->fold("AGENT:" . $this->types["AGENT"]) . "\n";
498  } else {
499  $agent = "";
500  }
501  break;
502  case "ORG":
503  if (strcmp($this->types["ORG"], "") != 0) {
504  $org = $this->fold("ORG:" . $this->types["ORG"]) . "\n";
505  } else {
506  $org = "";
507  }
508  break;
509  case "CATEGORIES":
510  if (strcmp($this->types["CATEGORIES"], "") != 0) {
511  $categories = $this->fold("CATEGORIES:" . $this->types["CATEGORIES"]) . "\n";
512  } else {
513  $categories = "";
514  }
515  break;
516  case "NOTE":
517  if (strcmp($this->types["NOTE"], "") != 0) {
518  $note = $this->fold("NOTE:" . $this->types["NOTE"]) . "\n";
519  } else {
520  $note = "";
521  }
522  break;
523  case "PRODID":
524  if (strcmp($this->types["PRODID"], "") != 0) {
525  $prodid = $this->fold("PRODID:" . $this->types["PRODID"]) . "\n";
526  } else {
527  $prodid = "";
528  }
529  break;
530  case "REV":
531  if (strcmp($this->types["REV"], "") != 0) {
532  $rev = $this->fold("REV:" . $this->types["REV"]) . "\n";
533  } else {
534  $rev = "";
535  }
536  break;
537  case "SORT-STRING":
538  if (strcmp($this->types["SORT-STRING"], "") != 0) {
539  $sortstring = $this->fold("SORT-STRING:" . $this->types["SORT-STRING"]) . "\n";
540  } else {
541  $sortstring = "";
542  }
543  break;
544  case "SOUND":
545  $sound = "";
546  if (is_array($this->types["SOUND"])) {
547  if (strcmp($this->types["SOUND"]["VALUE"], "") != 0) {
548  $sound = $this->fold("SOUND;VALUE=uri:" . $this->types["SOUND"]["VALUE"]) . "\n";
549  } elseif (strcmp($this->types["SOUND"]["ENCODING"], "") != 0) {
550  $sound = "SOUND;ENCODING=" . $this->types["SOUND"]["ENCODING"];
551  if (strcmp($this->types["SOUND"]["TYPE"], "") != 0) {
552  $sound .= ";TYPE=" . $this->types["SOUND"]["TYPE"];
553  }
554  $sound .= ":" . $this->types["SOUND"]["SOUND"];
555  $sound = $this->fold($sound) . "\n";
556  }
557  }
558  break;
559  case "UID":
560  $uid = "";
561  if (is_array($this->types["UID"])) {
562  if (strcmp($this->types["UID"]["UID"], "") != 0) {
563  $uid = "UID";
564  if (strcmp($this->types["UID"]["TYPE"], "") != 0) {
565  $uid .= ";TYPE=" . $this->types["UID"]["TYPE"];
566  }
567  $uid .= ":" . $this->types["UID"]["UID"];
568  $uid = $this->fold($uid) . "\n";
569  }
570  }
571  break;
572  case "URL":
573  if (strcmp($this->types["URL"], "") != 0) {
574  $url = $this->fold("URL:" . $this->types["URL"]) . "\n";
575  } else {
576  $url = "";
577  }
578  break;
579  case "KEY":
580  $key = "";
581  if (is_array($this->types["KEY"])) {
582  if (strcmp($this->types["KEY"]["KEY"], "") != 0) {
583  $key = "KEY";
584  if (strcmp($this->types["KEY"]["TYPE"], "") != 0) {
585  $key .= ";TYPE=" . $this->types["KEY"]["TYPE"];
586  }
587  if (strcmp($this->types["KEY"]["ENCODING"], "") != 0) {
588  $key .= ";ENCODING=" . $this->types["KEY"]["ENCODING"];
589  }
590  $key .= ":" . $this->types["KEY"]["KEY"];
591  $key = $this->fold($key) . "\n";
592  }
593  }
594  break;
595  case "CLASS":
596  if (strcmp($this->types["CLASS"], "") != 0) {
597  $class = $this->fold("CLASS:" . $this->types["CLASS"]) . "\n";
598  } else {
599  $class = "";
600  }
601  break;
602  }
603  }
604  $vcard .= $fn . $n . $nickname . $photo . $bday . $adr . $label . $tel . $email . $mailer .
605  $tz . $geo . $title . $role . $logo . $agent . $org . $categories . $note . $prodid .
606  $rev . $sortstring . $sound . $uid . $url . $class . $key;
607  $vcard .= "END:vCard\n";
608  return $vcard;
609  }
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:193
const TEL_TYPE_CAR
$type
const EMAIL_TYPE_INTERNET
const ADR_TYPE_PARCEL
const TEL_TYPE_PREF
const EMAIL_TYPE_x400
const TEL_TYPE_FAX
const ADR_TYPE_DOM
const TEL_TYPE_MODEM
const ADR_TYPE_WORK
const TEL_TYPE_VIDEO
const TEL_TYPE_HOME
const TEL_TYPE_WORK
const ADR_TYPE_POSTAL
const TEL_TYPE_BBS
fold($string="", $length=75)
Fold a string according to RFC 2425.
const TEL_TYPE_CELL
$n
Definition: RandomTest.php:85
Create styles array
The data for the language used.
const TEL_TYPE_VOICE
const TEL_TYPE_MSG
const ADR_TYPE_INTL
const ADR_TYPE_HOME
const TEL_TYPE_PAGER
static getLogger($a_component_id)
Get component logger.
$url
const TEL_TYPE_ISDN
$key
Definition: croninfo.php:18
const ADR_TYPE_PREF
const EMAIL_TYPE_PREF
const TEL_TYPE_PCS
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:

◆ encode()

ilvCard::encode (   $string)

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

Encode data with "b" type encoding according to RFC 2045

Parameters
string$stringBinary string to be encoded
Returns
Encoded binary string public

Definition at line 142 of file class.ilvCard.php.

References escape(), and quoted_printable_encode().

Referenced by setLogo(), setPhoto(), and setSound().

143  {
144  return escape(quoted_printable_encode($string));
145  }
escape($string)
Escapes a string according to RFC 2426.
quoted_printable_encode($input, $line_max=76)
Creates a quoted printable encoded string according to RFC 2045.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ escape()

ilvCard::escape (   $string)

Escapes a string according to RFC 2426.

Escapes a string according to RFC 2426

Parameters
string$stringString to be escaped
Returns
Escaped string public

Definition at line 182 of file class.ilvCard.php.

Referenced by encode(), explodeVar(), setAgent(), setClassification(), setEmail(), setFormattedName(), setLabel(), setMailer(), setNote(), setPhone(), setProductId(), setRevision(), setRole(), setSortString(), setTimezone(), setTitle(), setUID(), and setURL().

183  {
184  $string = preg_replace("/(?<!\\\\)(\\\\)([^;,n\\\\])/", "\${1}\${1}\${2}", $string);
185  $string = preg_replace("/(?<!\\\\);/", "\\;", $string);
186  $string = preg_replace("/(?<!\\\\),/", "\\,", $string);
187  $string = preg_replace("/\n/", "\\n", $string);
188  return $string;
189  }
+ Here is the caller graph for this function:

◆ explodeVar()

& ilvCard::explodeVar (   $variable,
  $separator = "," 
)

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

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

Parameters
string$variableString to be splitted
string$separatorSeparator string
Returns
Escaped string public

Definition at line 201 of file class.ilvCard.php.

References $index, and escape().

Referenced by setAddress(), setCategories(), setName(), setNickname(), and setOrganization().

202  {
203  $exploded = explode($separator, $variable);
204  foreach ($exploded as $index => $var) {
205  $exploded[$index] = $this->escape($var);
206  }
207  return $exploded;
208  }
$index
Definition: metadata.php:60
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fold()

ilvCard::fold (   $string = "",
  $length = 75 
)

Fold a string according to RFC 2425.

Fold a string according to RFC 2425

Parameters
string$stringString to be folded
integer$lengthMaximum length of a line
Returns
string Folded string public

Definition at line 157 of file class.ilvCard.php.

References $i.

Referenced by buildVCard().

158  {
159  $folded_string = "";
160  preg_match_all("/(.{1,74})/", $string, $matches);
161  for ($i = 0; $i < count($matches[1]); $i++) {
162  if ($i < (count($matches[1])-1)) {
163  $matches[1][$i] .= "\n";
164  }
165  if ($i > 0) {
166  $matches[1][$i] = " " . $matches[1][$i];
167  }
168  $folded_string .= $matches[1][$i];
169  }
170  return $folded_string;
171  }
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ getFilename()

ilvCard::getFilename ( )

Definition at line 1699 of file class.ilvCard.php.

References $filename.

1700  {
1701  if (strcmp($this->filename, "") == 0) {
1702  return "vcard.vcf";
1703  } else {
1704  return $this->filename;
1705  }
1706  }
$filename
The filename of the vCard used when saving the vCard.

◆ getMimetype()

ilvCard::getMimetype ( )

Definition at line 1708 of file class.ilvCard.php.

1709  {
1710  return "text/x-vcard";
1711  }

◆ quoted_printable_encode()

ilvCard::quoted_printable_encode (   $input,
  $line_max = 76 
)

Creates a quoted printable encoded string according to RFC 2045.

Creates a quoted printable encoded string according to RFC 2045. The method was taken from the php documentation discussion forum

Parameters
string$inputA binary string to encode
integer$line_maxThe maximum number of characters per line for the result string
Returns
Quoted printable encoded string public

Definition at line 622 of file class.ilvCard.php.

References $i, $output, and array.

Referenced by encode().

623  {
624  $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
625  $lines = preg_split("/(?:\r\n|\r|\n)/", $input);
626  $eol = "\r\n";
627  $linebreak = "=0D=0A";
628  $escape = "=";
629  $output = "";
630 
631  for ($j=0;$j<count($lines);$j++) {
632  $line = $lines[$j];
633  $linlen = strlen($line);
634  $newline = "";
635  for ($i = 0; $i < $linlen; $i++) {
636  $c = substr($line, $i, 1);
637  $dec = ord($c);
638  if (($dec == 32) && ($i == ($linlen - 1))) { // convert space at eol only
639  $c = "=20";
640  } elseif (($dec == 61) || ($dec < 32) || ($dec > 126)) { // always encode "\t", which is *not* required
641  $h2 = floor($dec/16);
642  $h1 = floor($dec%16);
643  $c = $escape . $hex["$h2"] . $hex["$h1"];
644  }
645  if ((strlen($newline) + strlen($c)) >= $line_max) { // CRLF is not counted
646  $output .= $newline . $escape . $eol; // soft line break; " =\r\n" is okay
647  $newline = " ";
648  }
649  $newline .= $c;
650  } // end of for
651  $output .= $newline;
652  if ($j<count($lines)-1) {
653  $output .= $linebreak;
654  }
655  }
656  return trim($output);
657  }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ setAddress()

ilvCard::setAddress (   $po_box = "",
  $extended_address = "",
  $street_address = "",
  $locality = "",
  $region = "",
  $postal_code = "",
  $country = "",
  $type = 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
integer$typeThe address type (can be combined with the + operator) public

Definition at line 907 of file class.ilvCard.php.

References $type, ADR_TYPE_INTL, ADR_TYPE_NONE, ADR_TYPE_PARCEL, ADR_TYPE_POSTAL, ADR_TYPE_WORK, array, and explodeVar().

916  {
917  if ($type == ADR_TYPE_NONE) {
919  }
920  $po_box = join(",", $this->explodeVar($po_box));
921  $extended_address = join(",", $this->explodeVar($extended_address));
922  $street_address = join(",", $this->explodeVar($street_address));
923  $locality = join(",", $this->explodeVar($locality));
924  $region = join(",", $this->explodeVar($region));
925  $postal_code = join(",", $this->explodeVar($postal_code));
926  $country = join(",", $this->explodeVar($country));
927  array_push($this->types["ADR"], array(
928  "POBOX" => $po_box,
929  "EXTENDED_ADDRESS" => $extended_address,
930  "STREET_ADDRESS" => $street_address,
931  "LOCALITY" => $locality,
932  "REGION" => $region,
933  "POSTAL_CODE" => $postal_code,
934  "COUNTRY" => $country,
935  "TYPE" => $type
936  ));
937  }
$type
const ADR_TYPE_PARCEL
& explodeVar($variable, $separator=",")
Splits a variable into an array using a separator and escapes every value.
const ADR_TYPE_WORK
const ADR_TYPE_POSTAL
Create styles array
The data for the language used.
const ADR_TYPE_NONE
RFC 2426 vCard MIME Directory Profile 3.0 class.
const ADR_TYPE_INTL
+ Here is the call graph for this function:

◆ setAgent()

ilvCard::setAgent (   $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:Susan Thomas:+1-919-555- 1234\;INTERNET:sthom.nosp@m.as@h.nosp@m.ost.c.nosp@m.om: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 public

Definition at line 1300 of file class.ilvCard.php.

References escape().

1301  {
1302  $this->types["AGENT"] = $this->escape($agent);
1303  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setBirthday()

ilvCard::setBirthday (   $year,
  $month,
  $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
integer$yearThe year of the birthday
integer$monthThe month of the birthday
integer$dayThe day of the birthday public

Definition at line 839 of file class.ilvCard.php.

840  {
841  if (($year < 1) or ($day < 1) or ($month < 1)) {
842  $this->types["BDAY"] = "";
843  } else {
844  $this->types["BDAY"] = sprintf("%04d-%02d-%02d", $year, $month, $day);
845  }
846  }

◆ setCategories()

ilvCard::setCategories (   $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).

Parameters
array$categoriesCategory information public

Definition at line 1354 of file class.ilvCard.php.

References explodeVar().

1355  {
1356  $categories = join(",", $this->explodeVar($categories));
1357  $this->types["CATEGORIES"] = $categories;
1358  }
& explodeVar($variable, $separator=",")
Splits a variable into an array using a separator and escapes every value.
+ Here is the call graph for this function:

◆ setClassification()

ilvCard::setClassification (   $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 public

Definition at line 1639 of file class.ilvCard.php.

References escape().

1640  {
1641  $this->types["CLASS"] = $this->escape($classification);
1642  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setEmail()

ilvCard::setEmail (   $address = "",
  $type = 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
integer$typeThe address type (can be combined with the + operator) public

Definition at line 1067 of file class.ilvCard.php.

References $type, array, and escape().

1068  {
1069  array_push($this->types["EMAIL"], array(
1070  "EMAIL" => $this->escape($address),
1071  "TYPE" => $type
1072  ));
1073  }
$type
Create styles array
The data for the language used.
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setFormattedName()

ilvCard::setFormattedName (   $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.

Parameters
string$formatted_nameThe formatted text public

Definition at line 679 of file class.ilvCard.php.

References escape().

Referenced by setName().

680  {
681  $this->types["FN"] = $this->escape($formatted_name);
682  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setKey()

ilvCard::setKey (   $key = "",
  $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 public

Definition at line 1688 of file class.ilvCard.php.

References $key, $type, and array.

1689  {
1690  $encoding = "b";
1691  $key = base64_encode($key);
1692  $this->types["KEY"] = array(
1693  "KEY" => $key,
1694  "TYPE" => $type,
1695  "ENCODING" => $encoding
1696  );
1697  }
$type
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18

◆ setLabel()

ilvCard::setLabel (   $label = "",
  $type = 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 Main Street Town\, CA 91921-1234 .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
integer$typeThe address type (can be combined with the + operator) public

Definition at line 975 of file class.ilvCard.php.

References $type, ADR_TYPE_INTL, ADR_TYPE_NONE, ADR_TYPE_PARCEL, ADR_TYPE_POSTAL, ADR_TYPE_WORK, array, and escape().

976  {
977  if ($type == ADR_TYPE_NONE) {
979  }
980  $this->types["LABEL"] = array(
981  "LABEL" => $this->escape($label),
982  "TYPE" => $type
983  );
984  }
$type
const ADR_TYPE_PARCEL
const ADR_TYPE_WORK
const ADR_TYPE_POSTAL
Create styles array
The data for the language used.
const ADR_TYPE_NONE
RFC 2426 vCard MIME Directory Profile 3.0 class.
const ADR_TYPE_INTL
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setLogo()

ilvCard::setLogo (   $logo,
  $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 public

Definition at line 1255 of file class.ilvCard.php.

References $type, array, and encode().

1256  {
1257  $value = "";
1258  $encoding = "";
1259  if (preg_match("/^http/", $logo)) {
1260  $value = $this->encode($logo);
1261  } else {
1262  $encoding = "b";
1263  $logo = base64_encode($logo);
1264  }
1265  $this->types["LOGO"] = array(
1266  "VALUE" => $value,
1267  "TYPE" => $type,
1268  "ENCODING" => $encoding,
1269  "LOGO" => $logo
1270  );
1271  }
$type
Create styles array
The data for the language used.
encode($string)
Encode data with "b" type encoding according to RFC 2045.
+ Here is the call graph for this function:

◆ setMailer()

ilvCard::setMailer (   $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 public

Definition at line 1095 of file class.ilvCard.php.

References $name, and escape().

1096  {
1097  $this->types["MAILER"] = $this->escape($name);
1098  }
if($format !==null) $name
Definition: metadata.php:146
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setName()

ilvCard::setName (   $family_name,
  $given_name = "",
  $additional_names = "",
  $honorific_prefixes = "",
  $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 public

Definition at line 713 of file class.ilvCard.php.

References explodeVar(), and setFormattedName().

714  {
715  $familynames =&$this->explodeVar($family_name);
716  $givennames =&$this->explodeVar($given_name);
717  $addnames =&$this->explodeVar($additional_names);
718  $prefixes =&$this->explodeVar($honorific_prefixes);
719  $suffixes =&$this->explodeVar($honorific_suffixes);
720 
721  $this->types["N"] =
722  join(",", $familynames) .
723  ";" .
724  join(",", $givennames) .
725  ";" .
726  join(",", $addnames) .
727  ";" .
728  join(",", $prefixes) .
729  ";" .
730  join(",", $suffixes);
731 
732  $this->filename = "$given_name" . "_" . "$family_name" . ".vcf";
733  if (strcmp($this->types["FN"], "") == 0) {
734  $fn = trim("$honorific_prefixes $given_name $additional_names $family_name $honorific_suffixes");
735  $fn = preg_replace("/\s{2,10}/", " ", $fn);
736  $this->setFormattedName($fn);
737  }
738  }
setFormattedName($formatted_name)
Sets the value for the vCard FN type.
& explodeVar($variable, $separator=",")
Splits a variable into an array using a separator and escapes every value.
+ Here is the call graph for this function:

◆ setNickname()

ilvCard::setNickname (   $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.

Parameters
string$formatted_nameThe formatted text public

Definition at line 760 of file class.ilvCard.php.

References explodeVar().

761  {
762  $nicknames =&$this->explodeVar($nickname);
763  $this->types["NICKNAME"] = join(",", $nicknames);
764  }
& explodeVar($variable, $separator=",")
Splits a variable into an array using a separator and escapes every value.
+ Here is the call graph for this function:

◆ setNote()

ilvCard::setNote (   $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 public

Definition at line 1379 of file class.ilvCard.php.

References escape().

1380  {
1381  $this->types["NOTE"] = $this->escape($note);
1382  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setOrganization()

ilvCard::setOrganization (   $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 public

Definition at line 1326 of file class.ilvCard.php.

References explodeVar().

1327  {
1328  $organization = join(";", $this->explodeVar($organization, ";"));
1329  $this->types["ORG"] = $organization;
1330  }
& explodeVar($variable, $separator=",")
Splits a variable into an array using a separator and escapes every value.
+ Here is the call graph for this function:

◆ setPhone()

ilvCard::setPhone (   $number = "",
  $type = 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
integer$typeThe address type (can be combined with the + operator) public

Definition at line 1033 of file class.ilvCard.php.

References $type, array, and escape().

1034  {
1035  array_push($this->types["TEL"], array(
1036  "TEL" => $this->escape($number),
1037  "TYPE" => $type
1038  ));
1039  }
$type
Create styles array
The data for the language used.
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setPhoto()

ilvCard::setPhoto (   $photo,
  $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 public

Definition at line 801 of file class.ilvCard.php.

References $type, array, and encode().

802  {
803  $value = "";
804  $encoding = "";
805  if (preg_match("/^http/", $photo)) {
806  $value = $this->encode($photo);
807  } else {
808  $encoding = "b";
809  $photo = base64_encode($photo);
810  }
811  $this->types["PHOTO"] = array(
812  "VALUE" => $value,
813  "TYPE" => $type,
814  "ENCODING" => $encoding,
815  "PHOTO" => $photo
816  );
817  }
$type
Create styles array
The data for the language used.
encode($string)
Encode data with "b" type encoding according to RFC 2045.
+ Here is the call graph for this function:

◆ setPosition()

ilvCard::setPosition (   $latitude = "",
  $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
double$latitudeThe latitude of the position
double$longitudeThe longitude of the position public

Definition at line 1162 of file class.ilvCard.php.

References array.

1163  {
1164  $this->types["GEO"] = array(
1165  "LAT" => $latitude,
1166  "LON" => $longitude
1167  );
1168  }
Create styles array
The data for the language used.

◆ setProductId()

ilvCard::setProductId (   $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 public

Definition at line 1403 of file class.ilvCard.php.

References escape().

1404  {
1405  $this->types["PRODID"] = $this->escape($product_id);
1406  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setRevision()

ilvCard::setRevision (   $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 public

Definition at line 1429 of file class.ilvCard.php.

References escape().

1430  {
1431  $this->types["REV"] = $this->escape($revision_date);
1432  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setRole()

ilvCard::setRole (   $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 public

Definition at line 1217 of file class.ilvCard.php.

References escape().

1218  {
1219  $this->types["ROLE"] = $this->escape($role);
1220  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setSortString()

ilvCard::setSortString (   $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 public

Definition at line 1477 of file class.ilvCard.php.

References escape().

1478  {
1479  $this->types["SORT-STRING"] = $this->escape($string);
1480  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setSound()

ilvCard::setSound (   $sound = "",
  $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 public

Definition at line 1517 of file class.ilvCard.php.

References $type, array, and encode().

1518  {
1519  $value = "";
1520  $encoding = "";
1521  if (preg_match("/^http/", $sound)) {
1522  $value = $this->encode($sound);
1523  } else {
1524  $encoding = "b";
1525  $sound = base64_encode($sound);
1526  }
1527  $this->types["SOUND"] = array(
1528  "VALUE" => $value,
1529  "TYPE" => $type,
1530  "ENCODING" => $encoding,
1531  "SOUND" => $sound
1532  );
1533  }
$type
Create styles array
The data for the language used.
encode($string)
Encode data with "b" type encoding according to RFC 2045.
+ Here is the call graph for this function:

◆ setTimezone()

ilvCard::setTimezone (   $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 public

Definition at line 1123 of file class.ilvCard.php.

References escape().

1124  {
1125  $this->types["TZ"] = $this->escape($zone);
1126  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setTitle()

ilvCard::setTitle (   $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 public

Definition at line 1192 of file class.ilvCard.php.

References $title, and escape().

1193  {
1194  $this->types["TITLE"] = $this->escape($title);
1195  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setUID()

ilvCard::setUID (   $uid = "",
  $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 public

Definition at line 1561 of file class.ilvCard.php.

References $type, array, and escape().

1562  {
1563  $this->types["UID"] = array(
1564  "UID" => $this->escape($uid),
1565  "TYPE" => $type
1566  );
1567  }
$type
Create styles array
The data for the language used.
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setURL()

ilvCard::setURL (   $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 public

Definition at line 1585 of file class.ilvCard.php.

References escape().

1586  {
1587  $this->types["URL"] = $this->escape($uri);
1588  }
escape($string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setVersion()

ilvCard::setVersion (   $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 public

Definition at line 1606 of file class.ilvCard.php.

References $version.

1607  {
1608  $this->types["VERSION"] = $version;
1609  }

Field Documentation

◆ $filename

ilvCard::$filename

The filename of the vCard used when saving the vCard.

string

Definition at line 91 of file class.ilvCard.php.

Referenced by getFilename().

◆ $types

ilvCard::$types

An array containing the vCard types.

array

Definition at line 84 of file class.ilvCard.php.


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