ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilvCard Class Reference

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

+ Collaboration diagram for ilvCard:

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=ADR_TYPE_NONE)
 Sets the value for the vCard ADR type. More...
 
 setLabel (string $label="", int $type=ADR_TYPE_NONE)
 Sets the value for the vCard LABEL type. More...
 
 setPhone (string $number="", int $type=TEL_TYPE_VOICE)
 Sets the value for the vCard TEL type. More...
 
 setEmail (string $address="", int $type=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

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 56 of file class.ilvCard.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $version.

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

Member Function Documentation

◆ buildVCard()

ilvCard::buildVCard ( )

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

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

References $email, ILIAS\LTI\ToolProvider\$key, $type, $url, ADR_TYPE_DOM, ADR_TYPE_HOME, ADR_TYPE_INTL, ADR_TYPE_PARCEL, ADR_TYPE_POSTAL, ADR_TYPE_PREF, ADR_TYPE_WORK, 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.

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

◆ encode()

ilvCard::encode ( string  $string)

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

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

References escape(), and quoted_printable_encode().

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

104  : string
105  {
106  return $this->escape(quoted_printable_encode($string));
107  }
quoted_printable_encode(string $input, int $line_max=76)
Creates a quoted printable encoded string according to RFC 2045.
escape(string $string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ escape()

ilvCard::escape ( string  $string)

Escapes a string according to RFC 2426.

Definition at line 131 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().

131  : string
132  {
133  $string = preg_replace("/(?<!\\\\)(\\\\)([^;,n\\\\])/", "\${1}\${1}\${2}", $string);
134  $string = preg_replace("/(?<!\\\\);/", "\\;", $string);
135  $string = preg_replace("/(?<!\\\\),/", "\\,", $string);
136  $string = preg_replace("/\n/", "\\n", $string);
137  return $string;
138  }
+ Here is the caller graph for this function:

◆ explodeVar()

ilvCard::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 144 of file class.ilvCard.php.

References $index, and escape().

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

144  : array
145  {
146  $exploded = explode($separator, $variable);
147  foreach ($exploded as $index => $var) {
148  $exploded[$index] = $this->escape($var);
149  }
150  return $exploded;
151  }
$index
Definition: metadata.php:145
escape(string $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  $string = "")

Fold a string according to RFC 2425.

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

References $i.

Referenced by buildVCard().

112  : string
113  {
114  $folded_string = "";
115  preg_match_all("/(.{1,74})/", $string, $matches);
116  for ($i = 0, $iMax = count($matches[1]); $i < $iMax; $i++) {
117  if ($i < (count($matches[1]) - 1)) {
118  $matches[1][$i] .= "\n";
119  }
120  if ($i > 0) {
121  $matches[1][$i] = " " . $matches[1][$i];
122  }
123  $folded_string .= $matches[1][$i];
124  }
125  return $folded_string;
126  }
$i
Definition: metadata.php:41
+ Here is the caller graph for this function:

◆ getFilename()

ilvCard::getFilename ( )

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

References $filename.

1441  : string
1442  {
1443  if (strcmp($this->filename, "") == 0) {
1444  return "vcard.vcf";
1445  } else {
1446  return $this->filename;
1447  }
1448  }
string $filename

◆ getMimetype()

ilvCard::getMimetype ( )

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

1450  : string
1451  {
1452  return "text/x-vcard";
1453  }

◆ quoted_printable_encode()

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

Creates a quoted printable encoded string according to RFC 2045.

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

References $c, and $i.

Referenced by encode().

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

◆ setAddress()

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

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

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

812  : void {
813  if ($type == ADR_TYPE_NONE) {
815  }
816  $po_box = implode(",", $this->explodeVar($po_box));
817  $extended_address = implode(",", $this->explodeVar($extended_address));
818  $street_address = implode(",", $this->explodeVar($street_address));
819  $locality = implode(",", $this->explodeVar($locality));
820  $region = implode(",", $this->explodeVar($region));
821  $postal_code = implode(",", $this->explodeVar($postal_code));
822  $country = implode(",", $this->explodeVar($country));
823  $this->types["ADR"][] = array(
824  "POBOX" => $po_box,
825  "EXTENDED_ADDRESS" => $extended_address,
826  "STREET_ADDRESS" => $street_address,
827  "LOCALITY" => $locality,
828  "REGION" => $region,
829  "POSTAL_CODE" => $postal_code,
830  "COUNTRY" => $country,
831  "TYPE" => $type
832  );
833  }
$type
const ADR_TYPE_PARCEL
const ADR_TYPE_WORK
explodeVar(string $variable, string $separator=",")
Splits a variable into an array using a separator and escapes every value.
const ADR_TYPE_POSTAL
const ADR_TYPE_NONE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ADR_TYPE_INTL
+ Here is the call graph for this function:

◆ setAgent()

ilvCard::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: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

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

References escape().

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

◆ setBirthday()

ilvCard::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 743 of file class.ilvCard.php.

743  : void
744  {
745  if (($year < 1) or ($day < 1) or ($month < 1)) {
746  $this->types["BDAY"] = "";
747  } else {
748  $this->types["BDAY"] = sprintf("%04d-%02d-%02d", $year, $month, $day);
749  }
750  }

◆ setCategories()

ilvCard::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). public

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

References explodeVar().

1173  : void
1174  {
1175  $categories = implode(",", $this->explodeVar($categories));
1176  $this->types["CATEGORIES"] = $categories;
1177  }
explodeVar(string $variable, string $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 ( 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 1389 of file class.ilvCard.php.

References escape().

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

◆ setEmail()

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

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

References $type, and escape().

950  : void {
951  $this->types["EMAIL"][] = array(
952  "EMAIL" => $this->escape($address),
953  "TYPE" => $type
954  );
955  }
$type
escape(string $string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setFormattedName()

ilvCard::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 605 of file class.ilvCard.php.

References escape().

Referenced by setName().

605  : void
606  {
607  $this->types["FN"] = $this->escape($formatted_name);
608  }
escape(string $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 ( 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 1430 of file class.ilvCard.php.

References ILIAS\LTI\ToolProvider\$key, and $type.

1430  : void
1431  {
1432  $encoding = "b";
1433  $key = base64_encode($key);
1434  $this->types["KEY"] = array(
1435  "KEY" => $key,
1436  "TYPE" => $type,
1437  "ENCODING" => $encoding
1438  );
1439  }
$type
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ setLabel()

ilvCard::setLabel ( string  $label = "",
int  $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
int$typeThe address type (can be combined with the + operator)

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

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

868  : void {
869  if ($type == ADR_TYPE_NONE) {
871  }
872  $this->types["LABEL"] = array(
873  "LABEL" => $this->escape($label),
874  "TYPE" => $type
875  );
876  }
$type
const ADR_TYPE_PARCEL
const ADR_TYPE_WORK
escape(string $string)
Escapes a string according to RFC 2426.
const ADR_TYPE_POSTAL
const ADR_TYPE_NONE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ADR_TYPE_INTL
+ Here is the call graph for this function:

◆ setLogo()

ilvCard::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 1095 of file class.ilvCard.php.

References $type, and encode().

1095  : void
1096  {
1097  $value = "";
1098  $encoding = "";
1099  if (preg_match("/^http/", $logo)) {
1100  $value = $this->encode($logo);
1101  } else {
1102  $encoding = "b";
1103  $logo = base64_encode($logo);
1104  }
1105  $this->types["LOGO"] = array(
1106  "VALUE" => $value,
1107  "TYPE" => $type,
1108  "ENCODING" => $encoding,
1109  "LOGO" => $logo
1110  );
1111  }
$type
encode(string $string)
Encode data with "b" type encoding according to RFC 2045.
+ Here is the call graph for this function:

◆ setMailer()

ilvCard::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 971 of file class.ilvCard.php.

References $name, and escape().

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

◆ setName()

ilvCard::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 632 of file class.ilvCard.php.

References explodeVar(), and setFormattedName().

638  : void {
639  $familynames = $this->explodeVar($family_name);
640  $givennames = $this->explodeVar($given_name);
641  $addnames = $this->explodeVar($additional_names);
642  $prefixes = $this->explodeVar($honorific_prefixes);
643  $suffixes = $this->explodeVar($honorific_suffixes);
644 
645  $this->types["N"] =
646  implode(",", $familynames) .
647  ";" .
648  implode(",", $givennames) .
649  ";" .
650  implode(",", $addnames) .
651  ";" .
652  implode(",", $prefixes) .
653  ";" .
654  implode(",", $suffixes);
655 
656  $this->filename = $given_name . "_" . $family_name . ".vcf";
657  if (strcmp($this->types["FN"], "") === 0) {
658  $fn = trim("$honorific_prefixes $given_name $additional_names $family_name $honorific_suffixes");
659  $fn = preg_replace("/\s{2,10}/", " ", $fn);
660  $this->setFormattedName($fn);
661  }
662  }
setFormattedName(string $formatted_name)
Sets the value for the vCard FN type.
explodeVar(string $variable, string $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 ( 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 677 of file class.ilvCard.php.

References explodeVar().

677  : void
678  {
679  $nicknames = $this->explodeVar($nickname);
680  $this->types["NICKNAME"] = implode(",", $nicknames);
681  }
explodeVar(string $variable, string $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 ( 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 1191 of file class.ilvCard.php.

References escape().

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

◆ setOrganization()

ilvCard::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 1152 of file class.ilvCard.php.

References explodeVar().

1152  : void
1153  {
1154  $organization = implode(";", $this->explodeVar($organization, ";"));
1155  $this->types["ORG"] = $organization;
1156  }
explodeVar(string $variable, string $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 ( string  $number = "",
int  $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
int$typeThe address type (can be combined with the + operator)

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

References $type, and escape().

920  : void {
921  $this->types["TEL"][] = array(
922  "TEL" => $this->escape($number),
923  "TYPE" => $type
924  );
925  }
$type
escape(string $string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setPhoto()

ilvCard::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 709 of file class.ilvCard.php.

References $type, and encode().

712  : void {
713  $value = "";
714  $encoding = "";
715  if (preg_match("/^http/", $photo)) {
716  $value = $this->encode($photo);
717  } else {
718  $encoding = "b";
719  $photo = base64_encode($photo);
720  }
721  $this->types["PHOTO"] = array(
722  "VALUE" => $value,
723  "TYPE" => $type,
724  "ENCODING" => $encoding,
725  "PHOTO" => $photo
726  );
727  }
$type
encode(string $string)
Encode data with "b" type encoding according to RFC 2045.
+ Here is the call graph for this function:

◆ setPosition()

ilvCard::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 1023 of file class.ilvCard.php.

1023  : void
1024  {
1025  $this->types["GEO"] = array(
1026  "LAT" => $latitude,
1027  "LON" => $longitude
1028  );
1029  }

◆ setProductId()

ilvCard::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 1208 of file class.ilvCard.php.

References escape().

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

◆ setRevision()

ilvCard::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 1227 of file class.ilvCard.php.

References escape().

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

◆ setRole()

ilvCard::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 1065 of file class.ilvCard.php.

References escape().

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

◆ setSortString()

ilvCard::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 1264 of file class.ilvCard.php.

References escape().

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

◆ setSound()

ilvCard::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 1295 of file class.ilvCard.php.

References $type, and encode().

1295  : void
1296  {
1297  $value = "";
1298  $encoding = "";
1299  if (preg_match("/^http/", $sound)) {
1300  $value = $this->encode($sound);
1301  } else {
1302  $encoding = "b";
1303  $sound = base64_encode($sound);
1304  }
1305  $this->types["SOUND"] = array(
1306  "VALUE" => $value,
1307  "TYPE" => $type,
1308  "ENCODING" => $encoding,
1309  "SOUND" => $sound
1310  );
1311  }
$type
encode(string $string)
Encode data with "b" type encoding according to RFC 2045.
+ Here is the call graph for this function:

◆ setTimezone()

ilvCard::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 992 of file class.ilvCard.php.

References escape().

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

◆ setTitle()

ilvCard::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 1046 of file class.ilvCard.php.

References escape().

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

◆ setUID()

ilvCard::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 1331 of file class.ilvCard.php.

References $type, and escape().

1331  : void
1332  {
1333  $this->types["UID"] = array(
1334  "UID" => $this->escape($uid),
1335  "TYPE" => $type
1336  );
1337  }
$type
escape(string $string)
Escapes a string according to RFC 2426.
+ Here is the call graph for this function:

◆ setURL()

ilvCard::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 1349 of file class.ilvCard.php.

References escape().

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

◆ setVersion()

ilvCard::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 1364 of file class.ilvCard.php.

References $version.

1364  : void
1365  {
1366  $this->types["VERSION"] = $version;
1367  }
$version
Definition: plugin.php:24

Field Documentation

◆ $filename

string ilvCard::$filename

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

Referenced by getFilename().

◆ $types

array ilvCard::$types

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


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