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