Code Duplication    Length = 49-51 lines in 2 locations

lib/Settings/AdminSection.php 1 location

@@ 32-80 (lines=49) @@
29
use OCP\IURLGenerator;
30
use OCP\Settings\IIconSection;
31
32
class AdminSection implements IIconSection {
33
34
	/** @var IL10N */
35
	private $l;
36
	/** @var IURLGenerator */
37
	private $url;
38
39
	public function __construct(IL10N $l, IURLGenerator $url) {
40
		$this->l = $l;
41
		$this->url = $url;
42
	}
43
44
	/**
45
	 * returns the ID of the section. It is supposed to be a lower case string
46
	 *
47
	 * @returns string
48
	 */
49
	public function getID() {
50
		return 'nextnote';
51
	}
52
53
	/**
54
	 * returns the translated name as it should be displayed, e.g. 'LDAP / AD
55
	 * integration'. Use the L10N service to translate it.
56
	 *
57
	 * @return string
58
	 */
59
	public function getName() {
60
		return $this->l->t('Nextnote');
61
	}
62
63
	/**
64
	 * @return int whether the form should be rather on the top or bottom of
65
	 * the settings navigation. The sections are arranged in ascending order of
66
	 * the priority values. It is required to return a value between 0 and 99.
67
	 *
68
	 * keep the server setting at the top, right after "server settings"
69
	 */
70
	public function getPriority() {
71
		return 0;
72
	}
73
74
	/**
75
	 * {@inheritdoc}
76
	 */
77
	public function getIcon() {
78
		return $this->url->imagePath('nextnote', 'app-icon.svg');
79
	}
80
}
81

lib/Settings/PersonalSection.php 1 location

@@ 31-81 (lines=51) @@
28
use OCP\IURLGenerator;
29
use OCP\Settings\IIconSection;
30
31
class PersonalSection implements IIconSection {
32
	/** @var IURLGenerator */
33
	private $urlGenerator;
34
	/** @var IL10N */
35
	private $l;
36
	public function __construct(IURLGenerator $urlGenerator, IL10N $l) {
37
		$this->urlGenerator = $urlGenerator;
38
		$this->l = $l;
39
	}
40
	/**
41
	 * returns the relative path to an 16*16 icon describing the section.
42
	 * e.g. '/core/img/places/files.svg'
43
	 *
44
	 * @returns string
45
	 * @since 13.0.0
46
	 */
47
	public function getIcon() {
48
		return $this->urlGenerator->imagePath('nextnote', 'app-icon.svg');
49
	}
50
	/**
51
	 * returns the ID of the section. It is supposed to be a lower case string,
52
	 * e.g. 'ldap'
53
	 *
54
	 * @returns string
55
	 * @since 9.1
56
	 */
57
	public function getID() {
58
		return 'nextnote';
59
	}
60
	/**
61
	 * returns the translated name as it should be displayed, e.g. 'LDAP / AD
62
	 * integration'. Use the L10N service to translate it.
63
	 *
64
	 * @return string
65
	 * @since 9.1
66
	 */
67
	public function getName() {
68
		return $this->l->t('NextNote');
69
	}
70
	/**
71
	 * @return int whether the form should be rather on the top or bottom of
72
	 * the settings navigation. The sections are arranged in ascending order of
73
	 * the priority values. It is required to return a value between 0 and 99.
74
	 *
75
	 * E.g.: 70
76
	 * @since 9.1
77
	 */
78
	public function getPriority() {
79
		return 0;
80
	}
81
}