Files
oc-gcalendar-plugin/formwidgets/calendarselector/partials/_selector.htm
2023-01-15 20:27:27 +01:00

73 lines
3.1 KiB
HTML
Executable File

<div class="control-list">
<table class="table data">
<thead>
<tr>
<th class="list-checkbox">
<div class="checkbox nolabel">
<input type="checkbox" id="checkboxAll" />
<label for="checkboxAll"></label>
</div>
</th>
<th></th>
<th><a><?= e(trans('nicost.gcalendar::lang.settings.calendarList.columnName')) ?></a></th>
<th><a><?= e(trans('nicost.gcalendar::lang.settings.calendarList.columnRole')) ?></a></th>
<th><a><?= e(trans('nicost.gcalendar::lang.settings.calendarList.columnId')) ?></a></th>
</tr>
</thead>
<tbody>
<?php if (empty($calendars)): ?>
<tr class="no-data">
<td colspan="100" class="nolink">
<p class="no-data">
<?= e(trans('nicost.gcalendar::lang.settings.calendarList.emptyList')) ?>
</p>
</td>
</tr>
<?php else: ?>
<?php foreach ($calendars as $key=>$calendar): ?>
<tr>
<td class="list-checkbox nolink">
<div class="checkbox nolabel">
<input id="checkbox_<?= $key ?>"
type="checkbox"
name="Settings[calendar_selector][<?= $key ?>][checked]"
value="1"
<?php if (isset($saved_selector) && in_array($calendar->id, $saved_selector)): ?>
checked
<?php endif ?>
/>
<label for="checkbox_<?= $key ?>"></label>
</div>
</td>
<td><span style="width: 12px;height: 12px;display: inline-block;border-radius: 50%;background-color: <?= $calendar->backgroundColor ?>"></span>
<input type="hidden"
name="Settings[calendar_selector][<?= $key ?>][color]"
value="<?= $calendar->backgroundColor ?>"
/>
</td>
<td><?= $calendar->summary ?>
<input type="hidden"
name="Settings[calendar_selector][<?= $key ?>][name]"
value="<?= $calendar->summary ?>"
/>
</td>
<td><?= $calendar->accessRole ?></td>
<td><?= $calendar->id ?>
<input type="hidden"
name="Settings[calendar_selector][<?= $key ?>][id]"
value="<?= $calendar->id ?>"
/>
</td>
</tr>
<?php endforeach ?>
<?php endif ?>
</tbody>
</table>
</div>
<script>
$("#checkboxAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>