3{
6 $renderer =
$DIC->ui()->renderer();
7
8
9 $actions = array("All" => "#", "Upcoming events" => "#");
10 $aria_label = "filter entries";
11 $view_controls = array(
12 $f->viewControl()->mode($actions, $aria_label)->withActive(
"All")
13 );
14
15
16 $ptable =
$f->table()->presentation(
17 'Presentation Table',
18 $view_controls,
19 function ($row, $record, $ui_factory, $environment) {
20 return $row
21 ->withHeadline($record['title'])
22 ->withSubheadline($record['type'])
23 ->withImportantFields(
24 array(
25 $record['begin_date'],
26 $record['location'],
27 'Available Slots: ' => $record['bookings_available']
28 )
29 )
30
31 ->withContent(
32 $ui_factory->listing()->descriptive(
33 array(
34 'Targetgroup' => $record['target_group'],
35 'Goals' => $record['goals'],
36 'Topics' => $record['topics']
37 )
38 )
39 )
40
41 ->withFurtherFieldsHeadline('Detailed Information')
42 ->withFurtherFields(
43 array(
44 'Location: ' => $record['location'],
45 $record['address'],
46 'Date: ' => $record['date'],
47 'Available Slots: ' => $record['bookings_available'],
48 'Fee: ' => $record['fee']
49 )
50 )
51 ->withAction(
52 $ui_factory->button()->standard('book course', '#')
53 );
54 }
55 );
56
57
58 require('included_data.php');
60
61
62 return $renderer->render($ptable->withData(
$data));
63}