Calendar Sync V1

This commit is contained in:
2026-03-11 11:44:32 +01:00
parent 87f6839b0d
commit 2d5e9541c2
17 changed files with 3011 additions and 64 deletions

View File

@@ -1,6 +1,8 @@
<?php
use dokuwiki\Extension\SyntaxPlugin;
use dokuwiki\plugin\luxtools\CalendarService;
use dokuwiki\plugin\luxtools\CalendarSlot;
use dokuwiki\plugin\luxtools\ChronologicalCalendarWidget;
require_once(__DIR__ . '/../autoload.php');
@@ -85,7 +87,18 @@ class syntax_plugin_luxtools_calendar extends SyntaxPlugin
$month = (int)$data['month'];
$baseNs = (string)$data['base'];
$renderer->doc .= ChronologicalCalendarWidget::render($year, $month, $baseNs);
// Load slot indicators and colors for the calendar widget
$slots = CalendarSlot::loadEnabled($this);
$indicators = CalendarService::monthIndicators($slots, $year, $month);
$slotColors = [];
foreach ($slots as $slot) {
$color = $slot->getColor();
if ($color !== '') {
$slotColors[$slot->getKey()] = $color;
}
}
$renderer->doc .= ChronologicalCalendarWidget::render($year, $month, $baseNs, $indicators, $slotColors);
return true;
}