blob: df5524b44d5c169b10835bcbb2e4305f47683647 (
plain)
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
|
<?php
/* Icinga DB Web | (c) 2023 Icinga GmbH | GPLv2 */
namespace Icinga\Module\Icingadb\Web\Control;
/**
* View mode switcher to toggle between grid and list view
*/
class GridViewModeSwitcher extends ViewModeSwitcher
{
/** @var string Default view mode */
public const DEFAULT_VIEW_MODE = 'list';
/** @var array View mode-icon pairs */
public static $viewModes = [
'list' => 'default',
'grid' => 'grid'
];
protected function getTitle(string $viewMode): string
{
$active = null;
$inactive = null;
switch ($viewMode) {
case 'list':
$active = t('List view active');
$inactive = t('Switch to list view');
break;
case 'grid':
$active = t('Grid view active');
$inactive = t('Switch to grid view');
break;
}
return $viewMode === $this->getViewMode() ? $active : $inactive;
}
}
|