-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAdminPage.php
More file actions
50 lines (41 loc) · 1.38 KB
/
AdminPage.php
File metadata and controls
50 lines (41 loc) · 1.38 KB
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
50
<?php
namespace EvanG\Modules\MailSystem;
use EvanG\Modules\MailSystem\Helpers\CompatibilityHelper;
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 = CompatibilityHelper::getService(UserService::class);
$this->treeService = CompatibilityHelper::getService(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
]);
}
}