@@ -33,76 +33,76 @@ |
||
33 | 33 | |
34 | 34 | class AppSearch implements IProvider { |
35 | 35 | |
36 | - /** @var INavigationManager */ |
|
37 | - protected $navigationManager; |
|
38 | - |
|
39 | - /** @var IL10N */ |
|
40 | - protected $l; |
|
41 | - |
|
42 | - public function __construct(INavigationManager $navigationManager, |
|
43 | - IL10N $l) { |
|
44 | - $this->navigationManager = $navigationManager; |
|
45 | - $this->l = $l; |
|
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * @inheritDoc |
|
50 | - */ |
|
51 | - public function getId(): string { |
|
52 | - return 'settings_apps'; |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * @inheritDoc |
|
57 | - */ |
|
58 | - public function getName(): string { |
|
59 | - return $this->l->t('Apps'); |
|
60 | - } |
|
61 | - |
|
62 | - /** |
|
63 | - * @inheritDoc |
|
64 | - */ |
|
65 | - public function getOrder(string $route, array $routeParameters): int { |
|
66 | - return -50; |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * @inheritDoc |
|
71 | - */ |
|
72 | - public function search(IUser $user, ISearchQuery $query): SearchResult { |
|
73 | - $entries = $this->navigationManager->getAll('all'); |
|
74 | - |
|
75 | - $result = []; |
|
76 | - foreach ($entries as $entry) { |
|
77 | - if ( |
|
78 | - stripos($entry['name'], $query->getTerm()) === false && |
|
79 | - stripos($entry['id'], $query->getTerm()) === false |
|
80 | - ) { |
|
81 | - continue; |
|
82 | - } |
|
83 | - |
|
84 | - if (strpos($query->getRoute(), $entry['id'] . '.') === 0) { |
|
85 | - // Skip the current app, unlikely this is intended |
|
86 | - continue; |
|
87 | - } |
|
88 | - |
|
89 | - if ($entry['href'] === '') { |
|
90 | - // Nothing we can open, so ignore |
|
91 | - continue; |
|
92 | - } |
|
93 | - |
|
94 | - $result[] = new SearchResultEntry( |
|
95 | - '', |
|
96 | - $entry['name'], |
|
97 | - '', |
|
98 | - $entry['href'], |
|
99 | - 'icon-confirm' |
|
100 | - ); |
|
101 | - } |
|
102 | - |
|
103 | - return SearchResult::complete( |
|
104 | - $this->l->t('Apps'), |
|
105 | - $result |
|
106 | - ); |
|
107 | - } |
|
36 | + /** @var INavigationManager */ |
|
37 | + protected $navigationManager; |
|
38 | + |
|
39 | + /** @var IL10N */ |
|
40 | + protected $l; |
|
41 | + |
|
42 | + public function __construct(INavigationManager $navigationManager, |
|
43 | + IL10N $l) { |
|
44 | + $this->navigationManager = $navigationManager; |
|
45 | + $this->l = $l; |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * @inheritDoc |
|
50 | + */ |
|
51 | + public function getId(): string { |
|
52 | + return 'settings_apps'; |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * @inheritDoc |
|
57 | + */ |
|
58 | + public function getName(): string { |
|
59 | + return $this->l->t('Apps'); |
|
60 | + } |
|
61 | + |
|
62 | + /** |
|
63 | + * @inheritDoc |
|
64 | + */ |
|
65 | + public function getOrder(string $route, array $routeParameters): int { |
|
66 | + return -50; |
|
67 | + } |
|
68 | + |
|
69 | + /** |
|
70 | + * @inheritDoc |
|
71 | + */ |
|
72 | + public function search(IUser $user, ISearchQuery $query): SearchResult { |
|
73 | + $entries = $this->navigationManager->getAll('all'); |
|
74 | + |
|
75 | + $result = []; |
|
76 | + foreach ($entries as $entry) { |
|
77 | + if ( |
|
78 | + stripos($entry['name'], $query->getTerm()) === false && |
|
79 | + stripos($entry['id'], $query->getTerm()) === false |
|
80 | + ) { |
|
81 | + continue; |
|
82 | + } |
|
83 | + |
|
84 | + if (strpos($query->getRoute(), $entry['id'] . '.') === 0) { |
|
85 | + // Skip the current app, unlikely this is intended |
|
86 | + continue; |
|
87 | + } |
|
88 | + |
|
89 | + if ($entry['href'] === '') { |
|
90 | + // Nothing we can open, so ignore |
|
91 | + continue; |
|
92 | + } |
|
93 | + |
|
94 | + $result[] = new SearchResultEntry( |
|
95 | + '', |
|
96 | + $entry['name'], |
|
97 | + '', |
|
98 | + $entry['href'], |
|
99 | + 'icon-confirm' |
|
100 | + ); |
|
101 | + } |
|
102 | + |
|
103 | + return SearchResult::complete( |
|
104 | + $this->l->t('Apps'), |
|
105 | + $result |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php /** @var \OCP\IL10N $l */ ?> |
2 | 2 | <?php |
3 | 3 | script('user_ldap', [ |
4 | - 'renewPassword', |
|
4 | + 'renewPassword', |
|
5 | 5 | ]); |
6 | 6 | style('user_ldap', 'renewPassword'); |
7 | 7 | ?> |