Table of Contents
iCalEvents Plugin
Compatible with DokuWiki
- 2022-07-31 "Igor" unknown
- 2020-07-29 "Hogfather" unknown
- 2018-04-22 "Greebo" unknown
- 2017-02-19 "Frusterick Manners" yes
WARNING
This plugin is unmaintained, and it's not recommended to use it or rely on it. At some point in time (which may be in the past), it will stop working or be insecure. See https://github.com/real-or-random/dokuwiki-plugin-icalevents/issues/28#issuecomment-1059750388 for details.
Description
Many calendars can export their entries in the iCalendar (RFC 2445) format. This plugin can read such an iCalendar file (typically named *.ics
) from an URL or a mediafile and display events according to a template, e.g., as an HTML table.
This plugin is almost a complete rewrite, integrating the features of the unmaintained fork icalendar
.
Requirements
The current release requires at least PHP 5.5.5 or newer.
Running older PHP versions is a security risk anyway. Even PHP 5.5 and has already reached end of life and does not receive security patches anymore since July 2016.
Screenshots
Usage
To use the plugin, put the following line into any page of your wiki:
{{iCalEvents>https://host/myCalendar.ics}}
You can also add parameters:
{{iCalEvents>https://host/myCalendar.ics#from=today&to=+10 days&maxNumberOfEntries=100}}
Display all events from today within the next 10 days, but at most 100 events{{iCalEvents>https://host/myCalendar.ics#to=-1 day}}
Only display events starting before today
Instead of a URL, it is also possible to specify a local media file:
{{iCalEvents>myCalendar.ics#from=today}}
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
to | datetime | Hide events starting after this time. Accepts values accepted by strtotime. Set this to a value far in the future if you would like all events to be displayed, e.g., +10 years . (This parameter cannot be unset. Some values is necessary to limit the displayed occurrences of infinitely recurring events.) | +30 days |
from | datetime | If present, hide events starting before this time. Accepts values accepted by strtotime. | (none) |
maxNumberOfEntries | integer | Maximal number of events to display. | (none) |
showAs | string | Select template to display events. Default templates are table , tableWithoutSummary , list . You can modify these templates and add your own in /conf/dokuwiki.php . | table |
showEndDates | boolean | Whether the end date of an event should be displayed if it is the same as the start date. | false |
sort | asc or desc or off | Whether events should be sorted chronologically ascending or descending. If set to off , sorting is disabled and the events are displayed in the order in which they appear in the input file. This is good for performance if the events are already sorted. | asc |
dformat , tformat | string | Custom date / time format to display events (as accepted by strftime). | (global default in plugin configuration) |
Configuration
The plugin can be configured in the configuration manager. You can specify templates there. In a template, the following magic strings will be recognized and replaced for each event:
{summary}
: Summary{description}
: Description{location}
: Location{location_link}
: Location text with link to map service. The URL can be configured.{summary_link}
: Summary text with download link this single event.
Caching
Caching of the wiki page will be disabled if one of the following conditions holds:
- One of the
from
orto
parameters is a relative to the current time, e.g.,+30 days
. Note that30 days
is the default value forto
. - The rendered calendar is a local media file. This is necessary for security. It prevents users not having read access to the media file from seeing a cached rendered calendar which was rendered in a security context of a user with read access to the media file.
If you need caching for performance reasons, make sure to use a fixed time range and an external URL, which can of course point to a media file your DokuWiki installation.
Disable Caching
Even if none of the above conditions is true, it can make sense to disable caching, e.g., if a calendar at an external URL is updated often. In this case add ~~NOCACHE~~ to the page.
Backwards Compatibility
The following deprecated parameters are supported for backwards compatibility with older versions and compatibility with the deprecated icalendar plugin. Please use the new syntax as above.
previewDays
: If some integer n is specified, this is equivalent toto=+n days
.numberOfEntries
: Equivalent tomaxNumberOfEntries
.showAsList
: If set to true, this is equivalent toshowAs=list
.
Moreover, it is possible to {{iCalendar>
… instead of {{iCalEvents>
…
Version History
- Version 2017-06-16:
- Don't fail if there are no events to display
- Fail gracefully if the from/to string is invalid
- Version 2017-05-07:
- Fix sorting
- Use fruux/sabre-vobject as a backend (requires PHP >= 5.5.5)
- Version 2017-04-26:
- Restore compatibility with PHP 5.5
- Version 2017-04-16:
- Use fruux/sabre-vobject as a backend (requires PHP >= 5.5)
- Fix recurring events
- Fix icon path
- Improve compatibility with non-default renderers, e.g., ODT export
- Fix HTTP header for export of events
- Version 2016-09-26:
- Fix timezone handling for events specified in UTC
- Version 2016-08-18:
- Introduce dformat and tformat parameters
- Restore PHP 5.3 compatibility
- Version 2016-08-17
- new maintainer real-or-random: re-merged forked plugin icalendar and rewritten almost all parts
- date-based versioning
- switch to iCalcreator library
- use template system from icalendar plugin
- don't cache if event filter depends on date
- make map service configurable
- local media files can be used instead of files fetched via HTTP
- lots of small fixes and improvements
- Version 2.0.2: Another unofficial release by glen
- use lowercase plugin name for better compatibility with new dokuwiki
- NB! after upgrade you need manually to remove old
lib/plugins/iCalEvents
dir (new version installs intolib/plugins/icalevents
)
- Version 2.0.1: Unofficial release by glen
- bugfix for multiple calendars on page (error state was overwriting first calendar error state)
showEndDates
,dformat
configurable via wiki page as well, not only configshowCurrentWeek
option to highlight active week in output
- Version 2.0: Fullfilled customer requests:
- start and end date can be shown
- configurable date format
- Version 1.3: timezone id bugfix, little speed optimization and nasty bugfix for parsing descriptions
- Version 1.2: updated zip file
- Version 1.1: DokuWiki Links are rendered within iCal description texts.
- Version 1.0: Added localization for German and English.
- Version 0.9: First public release