xref: /webtrees/app/Module/FabTheme.php (revision ade503dfba8365d48c21ef618291c1a94004c6e1)
1*ade503dfSGreg Roach<?php
2*ade503dfSGreg Roach/**
3*ade503dfSGreg Roach * webtrees: online genealogy
4*ade503dfSGreg Roach * Copyright (C) 2019 webtrees development team
5*ade503dfSGreg Roach * This program is free software: you can redistribute it and/or modify
6*ade503dfSGreg Roach * it under the terms of the GNU General Public License as published by
7*ade503dfSGreg Roach * the Free Software Foundation, either version 3 of the License, or
8*ade503dfSGreg Roach * (at your option) any later version.
9*ade503dfSGreg Roach * This program is distributed in the hope that it will be useful,
10*ade503dfSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11*ade503dfSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12*ade503dfSGreg Roach * GNU General Public License for more details.
13*ade503dfSGreg Roach * You should have received a copy of the GNU General Public License
14*ade503dfSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15*ade503dfSGreg Roach */
16*ade503dfSGreg Roachdeclare(strict_types=1);
17*ade503dfSGreg Roach
18*ade503dfSGreg Roachnamespace Fisharebest\Webtrees\Module;
19*ade503dfSGreg Roach
20*ade503dfSGreg Roachuse Fisharebest\Webtrees\I18N;
21*ade503dfSGreg Roach
22*ade503dfSGreg Roach/**
23*ade503dfSGreg Roach * The F.A.B. theme.
24*ade503dfSGreg Roach */
25*ade503dfSGreg Roachclass FabTheme extends AbstractModule implements ModuleThemeInterface
26*ade503dfSGreg Roach{
27*ade503dfSGreg Roach    use ModuleThemeTrait;
28*ade503dfSGreg Roach
29*ade503dfSGreg Roach    /**
30*ade503dfSGreg Roach     * Where are our CSS, JS and other assets?
31*ade503dfSGreg Roach     */
32*ade503dfSGreg Roach    public const    ASSET_DIR  = 'themes/fab/css-2.0.0/';
33*ade503dfSGreg Roach
34*ade503dfSGreg Roach    protected const PERSON_BOX_CLASSES = [
35*ade503dfSGreg Roach        'M' => 'person_box',
36*ade503dfSGreg Roach        'F' => 'person_boxF',
37*ade503dfSGreg Roach        'U' => 'person_boxNN',
38*ade503dfSGreg Roach    ];
39*ade503dfSGreg Roach
40*ade503dfSGreg Roach    /**
41*ade503dfSGreg Roach     * How should this module be labelled on tabs, menus, etc.?
42*ade503dfSGreg Roach     *
43*ade503dfSGreg Roach     * @return string
44*ade503dfSGreg Roach     */
45*ade503dfSGreg Roach    public function title(): string
46*ade503dfSGreg Roach    {
47*ade503dfSGreg Roach        /* I18N: Name of a theme. */
48*ade503dfSGreg Roach        return I18N::translate('F.A.B.');
49*ade503dfSGreg Roach    }
50*ade503dfSGreg Roach
51*ade503dfSGreg Roach    /**
52*ade503dfSGreg Roach     * Misecellaneous dimensions, fonts, styles, etc.
53*ade503dfSGreg Roach     *
54*ade503dfSGreg Roach     * @param string $parameter_name
55*ade503dfSGreg Roach     *
56*ade503dfSGreg Roach     * @return string|int|float
57*ade503dfSGreg Roach     */
58*ade503dfSGreg Roach    public function parameter($parameter_name)
59*ade503dfSGreg Roach    {
60*ade503dfSGreg Roach        $parameters = [
61*ade503dfSGreg Roach            'chart-background-f'             => 'e9daf1',
62*ade503dfSGreg Roach            'chart-background-m'             => 'b1cff0',
63*ade503dfSGreg Roach            'chart-background-u'             => 'eeeeee',
64*ade503dfSGreg Roach            'chart-box-x'                    => 260,
65*ade503dfSGreg Roach            'chart-box-y'                    => 85,
66*ade503dfSGreg Roach            'chart-font-color'               => '000000',
67*ade503dfSGreg Roach            'chart-spacing-x'                => 5,
68*ade503dfSGreg Roach            'chart-spacing-y'                => 10,
69*ade503dfSGreg Roach            'compact-chart-box-x'            => 240,
70*ade503dfSGreg Roach            'compact-chart-box-y'            => 50,
71*ade503dfSGreg Roach            'distribution-chart-high-values' => '9ca3d4',
72*ade503dfSGreg Roach            'distribution-chart-low-values'  => 'e5e6ef',
73*ade503dfSGreg Roach            'distribution-chart-no-values'   => 'ffffff',
74*ade503dfSGreg Roach            'distribution-chart-x'           => 440,
75*ade503dfSGreg Roach            'distribution-chart-y'           => 220,
76*ade503dfSGreg Roach            'line-width'                     => 1.5,
77*ade503dfSGreg Roach            'shadow-blur'                    => 0,
78*ade503dfSGreg Roach            'shadow-color'                   => '',
79*ade503dfSGreg Roach            'shadow-offset-x'                => 0,
80*ade503dfSGreg Roach            'shadow-offset-y'                => 0,
81*ade503dfSGreg Roach            'stats-small-chart-x'            => 440,
82*ade503dfSGreg Roach            'stats-small-chart-y'            => 125,
83*ade503dfSGreg Roach            'stats-large-chart-x'            => 900,
84*ade503dfSGreg Roach            'image-dline'                    => static::ASSET_DIR . 'images/dline.png',
85*ade503dfSGreg Roach            'image-dline2'                   => static::ASSET_DIR . 'images/dline2.png',
86*ade503dfSGreg Roach            'image-hline'                    => static::ASSET_DIR . 'images/hline.png',
87*ade503dfSGreg Roach            'image-spacer'                   => static::ASSET_DIR . 'images/spacer.png',
88*ade503dfSGreg Roach            'image-vline'                    => static::ASSET_DIR . 'images/vline.png',
89*ade503dfSGreg Roach            'image-minus'                    => static::ASSET_DIR . 'images/minus.png',
90*ade503dfSGreg Roach            'image-plus'                     => static::ASSET_DIR . 'images/plus.png',
91*ade503dfSGreg Roach        ];
92*ade503dfSGreg Roach
93*ade503dfSGreg Roach        return $parameters[$parameter_name];
94*ade503dfSGreg Roach    }
95*ade503dfSGreg Roach
96*ade503dfSGreg Roach    /**
97*ade503dfSGreg Roach     * A list of CSS files to include for this page.
98*ade503dfSGreg Roach     *
99*ade503dfSGreg Roach     * @return string[]
100*ade503dfSGreg Roach     */
101*ade503dfSGreg Roach    public function stylesheets(): array
102*ade503dfSGreg Roach    {
103*ade503dfSGreg Roach        return [
104*ade503dfSGreg Roach            'themes/_common/css-2.0.0/style.css',
105*ade503dfSGreg Roach            'themes/fab/css-2.0.0/style.css',
106*ade503dfSGreg Roach        ];
107*ade503dfSGreg Roach    }
108*ade503dfSGreg Roach}
109