Calendar Sync V1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user