-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathTabs.php
executable file
·40 lines (36 loc) · 1.63 KB
/
Tabs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace KateMorley\Grid\UI;
use KateMorley\Grid\State\State;
/** Outputs the tabs. */
class Tabs {
/**
* Outputs the tabs.
*
* @param State $state The state
*/
public static function output(State $state): void {
$axes = new Axes($state);
?>
<section>
<div role="tablist">
<h2 id="tab-day" role="tab" aria-controls="tab-panel-day" aria-selected="true"><span>Past </span>day</h2>
<h2 id="tab-week" role="tab" aria-controls="tab-panel-week" aria-selected="false"><span>Past </span>week</h2>
<h2 id="tab-year" role="tab" aria-controls="tab-panel-year" aria-selected="false"><span>Past </span>year</h2>
<h2 id="tab-all" role="tab" aria-controls="tab-panel-all" aria-selected="false">All<span> time</span></h2>
</div>
<div id="tab-panel-day" role="tabpanel" aria-labelledby="tab-day" tabindex="0">
<?php Panel::output('Past day', $state->pastDay, $state->pastDaySeries, $axes, 12, 'g:ia'); ?>
</div>
<div id="tab-panel-week" role="tabpanel" aria-labelledby="tab-week" tabindex="0">
<?php Panel::output('Past week', $state->pastWeek, $state->pastWeekSeries, $axes, 1, 'l'); ?>
</div>
<div id="tab-panel-year" role="tabpanel" aria-labelledby="tab-year" tabindex="0">
<?php Panel::output('Past year', $state->pastYear, $state->pastYearSeries, $axes, 13, 'd/m/Y'); ?>
</div>
<div id="tab-panel-all" role="tabpanel" aria-labelledby="tab-all" tabindex="0">
<?php Panel::output('All time', $state->allTime, $state->allTimeSeries, $axes, 1, 'Y'); ?>
</div>
</section>
<?php
}
}