Quellcode Kalender:
Code: Alles auswählen
<we:listview type="object" classid="1" name="Kalender" calendar="month_table" datefield="Datum" weekstart="monday">
<?php
$GLOBALS['arr_entries'] = array();
foreach ($GLOBALS['lv']->calendar_struct['storage'] as $i_id => $i_time)
{
$str_day = date('Y-m-d', $i_time);
if (!isset($GLOBALS['arr_entries'][$str_day]))
{
$GLOBALS['arr_entries'][$str_day] = array();
}
$GLOBALS['arr_entries'][$str_day][] = (int) $i_id;
}
?>
<table>
<thead>
<tr>
<td colspan="7"><we:back><< </we:back><strong><we:field type="monthname"> <we:field type="year"><we:next> >></we:next></td>
</tr>
<tr>
<th>Mo</th>
<th>Di</th>
<th>Mi</th>
<th>Do</th>
<th>Fr</th>
<th>Sa</th>
<th>So</th>
</tr>
</thead>
<tbody>
<we:repeat>
<?php
// Globale PHP-Variable für die Anzahl der Einträge für den jeweiligen Tag definieren
$GLOBALS['i_quantity'] = 0;
// Wenn für den aktuellen Tag Einträge vorhanden sind...
if (isset($GLOBALS['arr_entries'][$GLOBALS['lv']->calendar_struct['date_human']]))
{
// Wert für die Anzahl in eine globale PHP-Variable speichern
$GLOBALS['i_quantity'] = (int) count($GLOBALS['arr_entries'][$GLOBALS['lv']->calendar_struct['date_human']]);
}
// Unterschiedliche (je nach Anzahl) Ausgabe-Zeichenkette erstellen
switch($GLOBALS['i_quantity'])
{
case 0: // keine Einträge
$GLOBALS['str_quantity'] = (string) '';
break;
case 1: // 1 Einträge
$GLOBALS['str_quantity'] = (string) $GLOBALS['i_quantity'].' Event';
break;
default: // mehrere Einträge
$GLOBALS['str_quantity'] = (string) $GLOBALS['i_quantity'].' Events';
break;
}
?>
<we:tr>
<td<?php
if($GLOBALS["lv"]->calendar_struct["date"] > 0 )
{
?>
<we:ifFieldNotEmpty type="calendar" match="day"> class="termin"<we:else> class="normal"</we:ifFieldNotEmpty>
<?php
}
?> >
<we:ifCurrentDate><span style="font-weight:bold;color:#a8af39;"></we:ifCurrentDate><we:ifFieldNotEmpty type="calendar" match="day">
<a href="/events/event-aus-kalender-objekt.php?date=1&selectedDay=<we:field type="year">-<we:field type="month">-<we:field type="day">&we_lv_date_Kalender=<we:field type="year">-<we:field type="month">-1" title="<?php echo $GLOBALS['str_quantity']; ?>"></we:ifFieldNotEmpty><we:field type="day"/><we:ifFieldNotEmpty type="calendar" match="day"></a></we:ifFieldNotEmpty>
<we:ifCurrentDate></span></we:ifCurrentDate>
</td>
</we:tr>
</we:repeat>
</tbody>
</table>
</we:listview>
Code: Alles auswählen
<we:listview type="object" name="Kalender" classid="1" searchable="false" calendar="day">
<we:repeat>
<div style="margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #999; ">
<span class="minitext">Veranstaltungstermin: <we:field name="Datum" /></span>
<h2><we:field name="Veranstaltung-Titel" alt="we_path" hyperlink="true" /></h2>
<we:field name="Veranstaltung-Text" />
</div>
</we:repeat>
</we:listview>