| 12 | use OCP\IURLGenerator; |
| 13 | |
| 14 | class Filter implements \OCP\Activity\IFilter |
| 15 | { |
| 16 | |
| 17 | private $l10n; |
| 18 | private $urlGenerator; |
| 19 | |
| 20 | public function __construct( |
| 21 | IL10N $l10n, |
| 22 | IURLGenerator $urlGenerator |
| 23 | ) |
| 24 | { |
| 25 | $this->l10n = $l10n; |
| 26 | $this->urlGenerator = $urlGenerator; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * @return string Lowercase a-z and underscore only identifier |
| 31 | * @since 11.0.0 |
| 32 | */ |
| 33 | public function getIdentifier() |
| 34 | { |
| 35 | return 'analytics'; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @return string A translated string |
| 40 | * @since 11.0.0 |
| 41 | */ |
| 42 | public function getName() |
| 43 | { |
| 44 | return $this->l10n->t('Analytics'); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @return int whether the filter should be rather on the top or bottom of |
| 49 | * the admin section. The filters are arranged in ascending order of the |
| 50 | * priority values. It is required to return a value between 0 and 100. |
| 51 | * @since 11.0.0 |
| 52 | */ |
| 53 | public function getPriority() |
| 54 | { |
| 55 | return 90; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @return string Full URL to an icon, empty string when none is given |
| 60 | * @since 11.0.0 |
| 61 | */ |
| 62 | public function getIcon() |
| 63 | { |
| 64 | return $this->urlGenerator->imagePath('analytics', 'app-dark.svg'); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @param string[] $types |
| 69 | * @return string[] An array of allowed apps from which activities should be displayed |
| 70 | * @since 11.0.0 |
| 71 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected