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