Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
Admin
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getForm
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 getSection
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getPriority
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace OCA\Cospend\Settings;
4
5use OCP\AppFramework\Http\TemplateResponse;
6use OCP\IConfig;
7use OCP\Settings\ISettings;
8
9class Admin implements ISettings {
10    /**
11     * @var IConfig
12     */
13    private $config;
14
15    public function __construct(IConfig $config)
16    {
17        $this->config = $config;
18    }
19
20    /**
21     * @return TemplateResponse
22     */
23    public function getForm(): TemplateResponse
24    {
25        $allow = $this->config->getAppValue('cospend', 'allowAnonymousCreation');
26
27        $parameters = [
28            'allowAnonymousCreation' => $allow
29        ];
30        return new TemplateResponse('cospend', 'admin', $parameters, '');
31    }
32
33    /**
34     * @return string the section ID, e.g. 'sharing'
35     */
36    public function getSection(): string
37    {
38        return 'additional';
39    }
40
41    /**
42     * @return int whether the form should be rather on the top or bottom of
43     * the admin section. The forms are arranged in ascending order of the
44     * priority values. It is required to return a value between 0 and 100.
45     *
46     * E.g.: 70
47     */
48    public function getPriority(): int
49    {
50        return 5;
51    }
52}