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