Completed
Pull Request — master (#93)
by Janis
11:26
created

Admin::getSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Nextcloud - OCR
5
 *
6
 * This file is licensed under the Affero General Public License version 3 or
7
 * later. See the COPYING file.
8
 *
9
 * @author Janis Koehr <[email protected]>
10
 * @copyright Janis Koehr 2017
11
 */
12
namespace OCA\Ocr\Settings;
13
14
use OCP\Settings\ISettings;
15
use OCP\IConfig;
16
use OCP\AppFramework\Http\TemplateResponse;
17
18
class Admin implements ISettings {
19
	
20
	/** @var IConfig */
21
	private $config;
22
	/**
23
	 *
24
	 * @param IConfig $config        	
25
	 */
26
	public function __construct(IConfig $config) {
27
		$this->config = $config;
28
	}
29
	/**
30
	 *
31
	 * @return TemplateResponse
32
	 */
33
	public function getForm() {
34
		return new TemplateResponse( 'ocr', 'settings-admin', [ 
35
				'languages' => $this->config->getAppValue ( 'ocr', 'languages' ) 
36
		], 'blank' );
37
	}
38
	/**
39
	 *
40
	 * @return string the section ID, e.g. 'sharing'
41
	 */
42
	public function getSection() {
43
		return 'ocr';
44
	}
45
	/**
46
	 *
47
	 * @return int whether the form should be rather on the top or bottom of
48
	 *         the admin section. The forms are arranged in ascending order of the
49
	 *         priority values. It is required to return a value between 0 and 100.
50
	 *        
51
	 *         keep the server setting at the top, right after "server settings"
52
	 */
53
	public function getPriority() {
54
		return 0;
55
	}
56
}