|
dolibarr 25.0.0-alpha
|
Function to manage calendar files (vcal/ical/...) More...
Go to the source code of this file.
Functions | |
| build_calfile ($format, $title, $desc, $events_array, $outputfile) | |
| Build a file from an array of events All input params and data must be encoded in $conf->charset_output. | |
| build_rssfile ($format, $title, $desc, $events_array, $outputfile, $filter='', $url='', $langcode='', $useurlforguid=false) | |
| Build a file from an array of events. | |
| rssCdata ($string) | |
| Return a text as a CDATA section of a XML file. | |
| rssUrl ($url) | |
| Return an URL ready to be written in a XML file, as a text or as an attribute value. | |
| format_cal ($format, $string) | |
| Encode for cal export. | |
| calFoldLine ($line) | |
| Fold a line of an iCal file as RFC 5545 section 3.1 asks: no more than 75 octets per line, the next lines start with a space. | |
| calEncode ($line) | |
| Cut string after 75 chars. | |
| quotedPrintEncode ($str, $forcal=0) | |
| Encode into vcal format. | |
| quotedPrintDecode ($str) | |
| Decode vcal format. | |
Function to manage calendar files (vcal/ical/...)
Definition in file xcal.lib.php.
| build_calfile | ( | $format, | |
| $title, | |||
| $desc, | |||
| $events_array, | |||
| $outputfile ) |
Build a file from an array of events All input params and data must be encoded in $conf->charset_output.
| string | $format | "vcal" or "ical" |
| string | $title | Title of export |
| string | $desc | Description of export |
| array<string,WebsitePage|array{uid:string,startdate:int,summary:string,desc:string,url?:?string,author:string,category?:?string,image?:?string,content?:?string}> | $events_array Array of events ("uid","startdate","summary","url","desc","author","category","image") or Array of WebsitePage | |
| string | $outputfile | Output file |
| string | $line |
Definition at line 36 of file xcal.lib.php.
References calFoldLine(), dol_now(), dol_print_date(), dol_string_nohtmltag(), dol_syslog(), dol_time_plus_duree(), dolChmod(), format_cal(), getDolGlobalInt(), and getDolGlobalString().
Referenced by ActionComm\build_exportfile().
| build_rssfile | ( | $format, | |
| $title, | |||
| $desc, | |||
| $events_array, | |||
| $outputfile, | |||
| $filter = '', | |||
| $url = '', | |||
| $langcode = '', | |||
| $useurlforguid = false ) |
Build a file from an array of events.
All input data must be encoded in $conf->charset_output
| string | $format | "rss" |
| string | $title | Title of export |
| string | $desc | Description of export |
| array<WebsitePage|array{uid:string,startdate:int,summary:string,desc:string,url?:?string,author:string,category?:?string,image?:?string,content?:?string}> | $events_array Array of events ("uid","startdate","summary","url","desc","author","category","image") or Array of WebsitePage | |
| string | $outputfile | Output file |
| string | $filter | (optional) Filter |
| string | $url | Url (If empty, forge URL for agenda RSS export) |
| string | $langcode | Language code to show in header |
| bool | $useurlforguid | If true, use URL as guid, else use uid as guid. Using URL as guid is better for RSS reader to detect changes of event, but it can cause problem if URL is not stable (for example if it contains a session id or a token that can change). |
Definition at line 337 of file xcal.lib.php.
References $dolibarr_main_url_root, $mysoc, date, dol_escape_xml(), dol_string_nohtmltag(), dol_syslog(), dolChmod(), getDolGlobalString(), getImageFromHtmlContent(), getRootURLFromURL(), rssCdata(), and rssUrl().
Referenced by ActionComm\build_exportfile().
| calEncode | ( | $line | ) |
Cut string after 75 chars.
Add CRLF+Space. line must be encoded in UTF-8 No more used by build_calfile(): see calFoldLine() that counts the octets.
| string | $line | String to convert |
Definition at line 598 of file xcal.lib.php.
References dol_strlen(), and dol_substr().
| calFoldLine | ( | $line | ) |
Fold a line of an iCal file as RFC 5545 section 3.1 asks: no more than 75 octets per line, the next lines start with a space.
A UTF-8 character is never cut.
| string | $line | Line, without end of line |
Definition at line 575 of file xcal.lib.php.
Referenced by build_calfile().
| format_cal | ( | $format, | |
| $string ) |
Encode for cal export.
| string | $format | "vcal" or "ical" |
| string | $string | String to encode |
Definition at line 551 of file xcal.lib.php.
References quotedPrintEncode().
Referenced by build_calfile().
| quotedPrintDecode | ( | $str | ) |
Decode vcal format.
| string | $str | String to convert |
Definition at line 699 of file xcal.lib.php.
Referenced by ICal\add_to_array(), and ICal\parse().
| quotedPrintEncode | ( | $str, | |
| $forcal = 0 ) |
Encode into vcal format.
| string | $str | String to convert |
| int | $forcal | (optional) 1 = For cal |
Definition at line 653 of file xcal.lib.php.
Referenced by format_cal().
| rssCdata | ( | $string | ) |
Return a text as a CDATA section of a XML file.
The end of a CDATA section ("]]>") found in the text is split so the text can not leave the section, and the characters not allowed in XML 1.0 are removed.
| string | $string | Text |
Definition at line 522 of file xcal.lib.php.
Referenced by build_rssfile().
| rssUrl | ( | $url | ) |
Return an URL ready to be written in a XML file, as a text or as an attribute value.
An "&" that already starts an entity is kept, so an URL that was already escaped is not escaped twice.
| string | $url | URL |
Definition at line 536 of file xcal.lib.php.
Referenced by build_rssfile().