-
Notifications
You must be signed in to change notification settings - Fork 5
/
AdminPage.php
49 lines (40 loc) · 1.26 KB
/
AdminPage.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
41
42
43
44
45
46
47
48
49
<?php
namespace EvanG\Modules\MailSystem;
use Fisharebest\Webtrees\Http\ViewResponseTrait;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Services\TreeService;
use Fisharebest\Webtrees\Services\UserService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
/**
* Edit the site preferences.
*/
class AdminPage implements RequestHandlerInterface
{
use ViewResponseTrait;
protected UserService $userService;
protected TreeService $treeService;
protected MailSystem $module;
public function __construct(MailSystem $msys)
{
$this->module = $msys;
$this->userService = app(UserService::class);
$this->treeService = app(TreeService::class);
}
/**
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$settings = $this->module->getSettings();
$this->layout = 'layouts/administration';
$title = I18N::translate('Mail system preferences');
return $this->viewResponse($this->module->name() . '::admin', [
'title' => $title,
'settings' => $settings
]);
}
}