1 | <?php |
||
20 | class Activity implements IExtension { |
||
21 | |||
22 | const APP_NAME = 'files_antivirus'; |
||
23 | |||
24 | /** |
||
25 | * Filter with all app related activities |
||
26 | */ |
||
27 | const FILTER_AVIR = 'files_antivirus'; |
||
28 | |||
29 | /** |
||
30 | * Activity types known to this extension |
||
31 | */ |
||
32 | const TYPE_VIRUS_DETECTED = 'virus_detected'; |
||
33 | |||
34 | /** |
||
35 | * Subject keys for translation of the subjections |
||
36 | */ |
||
37 | const SUBJECT_VIRUS_DETECTED = 'virus_detected'; |
||
38 | |||
39 | /** |
||
40 | * Infected file deletion notice |
||
41 | */ |
||
42 | const MESSAGE_FILE_DELETED = 'file_deleted'; |
||
43 | |||
44 | |||
45 | /** |
||
46 | * @var Factory |
||
47 | */ |
||
48 | protected $languageFactory; |
||
49 | |||
50 | /** |
||
51 | * @var IURLGenerator |
||
52 | */ |
||
53 | protected $URLGenerator; |
||
54 | |||
55 | /** |
||
56 | * @param Factory $languageFactory |
||
57 | * @param IURLGenerator $URLGenerator |
||
58 | */ |
||
59 | 3 | public function __construct(Factory $languageFactory, IURLGenerator $URLGenerator) { |
|
63 | |||
64 | protected function getL10N($languageCode = null) { |
||
67 | |||
68 | /** |
||
69 | * The extension can return an array of additional notification types. |
||
70 | * If no additional types are to be added false is to be returned |
||
71 | * |
||
72 | * @param string $languageCode |
||
73 | * |
||
74 | * @return array|false |
||
75 | */ |
||
76 | public function getNotificationTypes($languageCode) { |
||
85 | |||
86 | /** |
||
87 | * For a given method additional types to be displayed in the settings can be returned. |
||
88 | * In case no additional types are to be added false is to be returned. |
||
89 | * |
||
90 | * @param string $method |
||
91 | * @return array|false |
||
92 | */ |
||
93 | public function getDefaultTypes($method) { |
||
100 | |||
101 | /** |
||
102 | * A string naming the css class for the icon to be used can be returned. |
||
103 | * If no icon is known for the given type false is to be returned. |
||
104 | * |
||
105 | * @param string $type |
||
106 | * @return string|false |
||
107 | */ |
||
108 | 1 | public function getTypeIcon($type) { |
|
115 | |||
116 | /** |
||
117 | * The extension can translate a given message to the requested languages. |
||
118 | * If no translation is available false is to be returned. |
||
119 | * |
||
120 | * @param string $app |
||
121 | * @param string $text |
||
122 | * @param array $params |
||
123 | * @param boolean $stripPath |
||
124 | * @param boolean $highlightParams |
||
125 | * @param string $languageCode |
||
126 | * |
||
127 | * @return string|false |
||
128 | */ |
||
129 | public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) { |
||
143 | |||
144 | /** |
||
145 | * The extension can define the type of parameters for translation |
||
146 | * |
||
147 | * Currently known types are: |
||
148 | * * file => will strip away the path of the file and add a tooltip with it |
||
149 | * * username => will add the avatar of the user |
||
150 | * |
||
151 | * @param string $app |
||
152 | * @param string $text |
||
153 | * |
||
154 | * @return array|false |
||
155 | */ |
||
156 | 1 | public function getSpecialParameterList($app, $text) { |
|
159 | |||
160 | /** |
||
161 | * The extension can define the parameter grouping by returning the index as integer. |
||
162 | * In case no grouping is required false is to be returned. |
||
163 | * |
||
164 | * @param array $activity |
||
165 | * |
||
166 | * @return integer|false |
||
167 | */ |
||
168 | 1 | public function getGroupParameter($activity) { |
|
171 | |||
172 | /** |
||
173 | * The extension can define additional navigation entries. The array returned has to contain two keys 'top' |
||
174 | * and 'apps' which hold arrays with the relevant entries. |
||
175 | * If no further entries are to be added false is no be returned. |
||
176 | * |
||
177 | * @return array|false |
||
178 | */ |
||
179 | public function getNavigation() { |
||
195 | |||
196 | /** |
||
197 | * The extension can check if a customer filter (given by |
||
198 | * a query string like filter=abc) is valid or not. |
||
199 | * |
||
200 | * @param string $filterValue |
||
201 | * |
||
202 | * @return boolean |
||
203 | */ |
||
204 | public function isFilterValid($filterValue) { |
||
207 | |||
208 | /** |
||
209 | * The extension can filter the types based on the filter if required. |
||
210 | * In case no filter is to be applied false is to be returned unchanged. |
||
211 | * |
||
212 | * @param array $types |
||
213 | * @param string $filter |
||
214 | * |
||
215 | * @return array|false |
||
216 | */ |
||
217 | public function filterNotificationTypes($types, $filter) { |
||
220 | |||
221 | /** |
||
222 | * For a given filter the extension can specify the sql query conditions |
||
223 | * including parameters for that query. |
||
224 | * In case the extension does not know the filter false is to be returned. |
||
225 | * The query condition and the parameters are to be returned as array with two elements. |
||
226 | * E.g. return ['`app` = ? and `message` like ?', array('mail', 'ownCloud%')]; |
||
227 | * |
||
228 | * @param string $filter |
||
229 | * |
||
230 | * @return array|false |
||
231 | */ |
||
232 | public function getQueryForFilter($filter) { |
||
241 | } |
||
242 |