xref: /webtrees/app/Module/MinimalTheme.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 Minimal theme.
24*ade503dfSGreg Roach */
25*ade503dfSGreg Roachclass MinimalTheme 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/minimal/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('minimal');
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'   => 'dddddd',
62*ade503dfSGreg Roach            'chart-background-m'   => 'cccccc',
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-x' => 440,
72*ade503dfSGreg Roach            'distribution-chart-y' => 220,
73*ade503dfSGreg Roach            'line-width'           => 1.5,
74*ade503dfSGreg Roach            'shadow-blur'          => 0,
75*ade503dfSGreg Roach            'shadow-color'         => '',
76*ade503dfSGreg Roach            'shadow-offset-x'      => 0,
77*ade503dfSGreg Roach            'shadow-offset-y'      => 0,
78*ade503dfSGreg Roach            'stats-small-chart-x'  => 440,
79*ade503dfSGreg Roach            'stats-small-chart-y'  => 125,
80*ade503dfSGreg Roach            'stats-large-chart-x'  => 900,
81*ade503dfSGreg Roach            'image-dline'          => static::ASSET_DIR . 'images/dline.png',
82*ade503dfSGreg Roach            'image-dline2'         => static::ASSET_DIR . 'images/dline2.png',
83*ade503dfSGreg Roach            'image-hline'          => static::ASSET_DIR . 'images/hline.png',
84*ade503dfSGreg Roach            'image-spacer'         => static::ASSET_DIR . 'images/spacer.png',
85*ade503dfSGreg Roach            'image-vline'          => static::ASSET_DIR . 'images/vline.png',
86*ade503dfSGreg Roach            'image-minus'          => static::ASSET_DIR . 'images/minus.png',
87*ade503dfSGreg Roach            'image-plus'           => static::ASSET_DIR . 'images/plus.png',
88*ade503dfSGreg Roach        ];
89*ade503dfSGreg Roach
90*ade503dfSGreg Roach        return $parameters[$parameter_name];
91*ade503dfSGreg Roach    }
92*ade503dfSGreg Roach
93*ade503dfSGreg Roach    /**
94*ade503dfSGreg Roach     * A list of CSS files to include for this page.
95*ade503dfSGreg Roach     *
96*ade503dfSGreg Roach     * @return string[]
97*ade503dfSGreg Roach     */
98*ade503dfSGreg Roach    public function stylesheets(): array
99*ade503dfSGreg Roach    {
100*ade503dfSGreg Roach        return [
101*ade503dfSGreg Roach            'themes/_common/css-2.0.0/style.css',
102*ade503dfSGreg Roach            'themes/minimal/css-2.0.0/style.css',
103*ade503dfSGreg Roach        ];
104*ade503dfSGreg Roach    }
105*ade503dfSGreg Roach}
106