xref: /plugin/calendar/README.md (revision 2866e8271e4daef3b32eacb3a9082d02159b592b)
1# DokuWiki Calendar Plugin
2
3A feature-rich calendar plugin for DokuWiki with multiple themes, namespace management, Outlook/Google sync, recurring events, DokuWiki farm compatibility, and ACL-enforced security.
4
5## Features
6
7### Calendar Views
8- **Interactive Calendar** — Full-featured calendar with drag-friendly event management
9- **Static Calendar** — Read-only presentation mode for public display, with print support
10- **Event Panel** — Standalone scrollable event list with month navigation
11- **Sidebar Widget** — Compact week-at-a-glance itinerary for the sidebar
12
13### Event Management
14- Create, edit, and delete events with an inline dialog
15- Recurring events (daily, weekly, monthly, yearly) with interval control
16- Multi-day events with date ranges
17- Time conflict detection with visual badges
18- Task mode with completion tracking
19- Important event highlighting with ⭐
20- Namespace-based organization (e.g., `work`, `personal`, `team:projects`)
21
22### Namespace Filtering
23- **Wildcard** — `namespace=*` loads events from all namespaces
24- **Multi-namespace** — `namespace="work;personal"` loads from specific namespaces
25- **Prefixed wildcard** — `namespace=team:*` loads all sub-namespaces under `team`
26- **Exclude** — `exclude=journal` hides specific namespaces from wildcard views
27- **Multiple excludes** — `exclude="journal;drafts"` hides multiple namespaces (semicolon-separated)
28- Exclude matches by prefix: `exclude=journal` also hides `journal:daily`, `journal:notes:2026`, etc.
29
30### Themes
31- **Matrix** — Green on dark (default)
32- **Purple** — Purple/violet on dark
33- **Professional** — Blue on white
34- **Pink** — Hot pink with particle effects ✨
35- **Wiki** — Neutral gray (matches DokuWiki template)
36
37### Search
38- Real-time event filtering as you type
39- Configurable default search scope (current month or all dates) via admin setting
40- Toggle between month and all-dates search with the ��/�� button
41
42### Sync & Integration
43- **Outlook/Office 365** — Delta sync via Microsoft Graph API (cron-based)
44- **Google Calendar** — Two-way sync via OAuth 2.0
45- Full event backup/restore with versioned ZIP archives
46
47### Security
48- DokuWiki ACL enforcement on all read and write operations
49- CSRF token validation on all write actions
50- Rate limiting (60 req/min read, 30 req/min write)
51- Namespace path traversal prevention
52- Audit logging for admin operations
53
54### DokuWiki Farm Compatible
55- All data stored via `$conf['metadir']` and `$conf['cachedir']` (per-animal in farm setups)
56- Sync credentials can be stored per-animal in `data/meta/calendar/sync_config.php`
57- Falls back to shared plugin directory for non-farm installations
58- See [Farm Setup](#dokuwiki-farm-setup) for migration details
59
60### Localization
61- English (en)
62- German (de)
63- Czech (cs)
64
65## Installation
66
671. Download the latest release ZIP
682. Extract to `lib/plugins/calendar/` (the folder must be named `calendar`)
693. Clear DokuWiki's cache: **Admin → Configuration Settings → Save**
704. Access **Admin → Calendar Management** to configure themes and settings
71
72## Syntax
73
74### Interactive Calendar
75```
76{{calendar}}
77{{calendar namespace=work}}
78{{calendar namespace="personal;work"}}
79{{calendar namespace=projects:*}}
80{{calendar namespace=* exclude=journal}}
81{{calendar namespace=* exclude="journal;drafts"}}
82```
83
84### Static Calendar (Read-only)
85```
86{{calendar static}}
87{{calendar namespace=meetings static}}
88{{calendar month=6 year=2026 static}}
89{{calendar title="Club Events" theme=professional static}}
90{{calendar static noprint}}
91```
92
93### Event Panel
94```
95{{eventpanel}}
96{{eventpanel namespace=work height=500px}}
97{{eventpanel namespace=* exclude=archive}}
98```
99
100### Event List
101```
102{{eventlist}}
103{{eventlist range=week}}
104{{eventlist range=month namespace=meetings}}
105{{eventlist namespace=* exclude="personal;drafts"}}
106```
107
108### Sidebar Widget
109```
110{{eventlist sidebar}}
111{{eventlist sidebar namespace=important}}
112```
113
114### Parameter Reference
115
116| Parameter | Description | Example |
117|-----------|-------------|---------|
118| `namespace=X` | Filter by namespace | `namespace=work` |
119| `namespace=*` | Show all namespaces | `namespace=*` |
120| `namespace="X;Y"` | Multiple namespaces | `namespace="work;personal"` |
121| `exclude=X` | Exclude namespace(s) from wildcard | `exclude=journal` |
122| `exclude="X;Y"` | Exclude multiple namespaces | `exclude="journal;drafts"` |
123| `static` | Read-only calendar mode | `{{calendar static}}` |
124| `month=X` | Lock to month (1-12) | `month=6` |
125| `year=X` | Lock to year | `year=2026` |
126| `title="X"` | Custom title | `title="Team Events"` |
127| `theme=X` | Override theme | `theme=professional` |
128| `height=X` | Panel height (eventpanel only) | `height=500px` |
129| `range=X` | Date range (eventlist only) | `range=week` |
130| `noprint` | Hide print button (static only) | `noprint` |
131| `noheader` | Hide header (eventlist only) | `noheader` |
132| `sidebar` | Sidebar widget mode | `{{eventlist sidebar}}` |
133
134## Admin Features
135
136Access via **Admin → Calendar Management**:
137
138- **Manage Events** — Browse, search, filter, move, and bulk-delete events across namespaces
139- **Recurring Events** — Manage series with extend, trim, pause/resume, and pattern editing
140- **Namespace Management** — Create, rename, and delete namespaces
141- **Outlook Sync** — Configure Microsoft Graph API credentials and run/schedule syncs
142- **Google Sync** — OAuth 2.0 setup for Google Calendar integration
143- **Themes** — Select visual theme, configure week start day, itinerary default state, and default search scope
144- **Backup/Restore** — Create, download, and restore versioned backups
145- **Update** — Upload new plugin versions with automatic backup
146
147## DokuWiki Farm Setup
148
149This plugin is fully compatible with DokuWiki farm (multi-wiki) installations.
150
151### How It Works
152- Event data is stored in each animal's `$conf['metadir']/calendar/` directory
153- Plugin settings (theme, week start, etc.) are per-animal in `$conf['metadir']/calendar_*.txt`
154- Cache and rate-limit data use `$conf['cachedir']` (per-animal)
155- The plugin code itself is shared across the farm (standard DokuWiki behavior)
156
157### Sync Credentials
158Sync credentials (`sync_config.php`) can be stored per-animal:
159- **Per-animal (recommended):** `{animal}/data/meta/calendar/sync_config.php`
160- **Shared (fallback):** `lib/plugins/calendar/sync_config.php`
161
162The plugin checks the per-animal path first and falls back to the shared location.
163
164### Migration from Non-Farm
165If you're moving from a single-wiki install to a farm, move calendar data to each animal:
166```bash
167# Move calendar events
168mv /path/to/master/data/meta/calendar/ /path/to/animal/data/meta/calendar/
169
170# Move settings
171mv /path/to/master/data/meta/calendar_*.txt /path/to/animal/data/meta/
172```
173
174## Event Description Formatting
175
176Descriptions support DokuWiki-style formatting:
177
178- `**bold**` or `__bold__` → **bold**
179- `//italic//` → *italic*
180- `[[page|text]]` → DokuWiki links
181- `[text](url)` → Markdown links
182- Line breaks preserved
183
184## Architecture
185
186| Component | Purpose |
187|-----------|---------|
188| `syntax.php` | Wiki syntax parsing and HTML rendering |
189| `action.php` | AJAX endpoint handling with ACL enforcement |
190| `admin.php` | Admin panel UI and management operations |
191| `calendar-main.js` | Client-side calendar logic and UI |
192| `classes/FileHandler.php` | Atomic file operations with locking |
193| `classes/EventCache.php` | Caching layer with TTL |
194| `classes/RateLimiter.php` | AJAX rate limiting |
195| `classes/EventManager.php` | Event CRUD operations |
196| `classes/AuditLogger.php` | Admin audit trail |
197| `classes/GoogleCalendarSync.php` | Google Calendar OAuth integration |
198| `sync_outlook.php` | CLI Outlook sync script (cron) |
199
200## Requirements
201
202- DokuWiki (Hogfather or later)
203- PHP 7.4+
204- Modern browser (Chrome, Firefox, Edge, Safari)
205
206## License
207
208GPL-2.0
209
210## Author
211
212atari911 (atari911@gmail.com)
213
214## Links
215
216- [DokuWiki Plugin Page](https://www.dokuwiki.org/plugin:calendar)
217- [GitHub Repository](https://github.com/atari911/dokuwiki-plugin-calendar)
218- [Issue Tracker](https://github.com/atari911/dokuwiki-plugin-calendar/issues)
219
220## Version
221
2227.2.6
223