1 | <?php |
||
15 | class Activity implements IExtension { |
||
16 | |||
17 | const APP_NAME = 'files_antivirus'; |
||
18 | |||
19 | /** |
||
20 | * Filter with all app related activities |
||
21 | */ |
||
22 | const FILTER_AVIR = 'files_antivirus'; |
||
23 | |||
24 | /** |
||
25 | * Activity types known to this extension |
||
26 | */ |
||
27 | const TYPE_VIRUS_DETECTED = 'virus_detected'; |
||
28 | |||
29 | /** |
||
30 | * Subject keys for translation of the subjections |
||
31 | */ |
||
32 | const SUBJECT_VIRUS_DETECTED = 'virus_detected'; |
||
33 | |||
34 | /** |
||
35 | * Infected file deletion notice |
||
36 | */ |
||
37 | const MESSAGE_FILE_DELETED = 'file_deleted'; |
||
38 | |||
39 | |||
40 | /** @var Factory */ |
||
41 | protected $languageFactory; |
||
42 | |||
43 | /** @var IURLGenerator */ |
||
44 | protected $URLGenerator; |
||
45 | |||
46 | /** |
||
47 | * @param Factory $languageFactory |
||
48 | * @param IURLGenerator $URLGenerator |
||
49 | */ |
||
50 | 3 | public function __construct(Factory $languageFactory, IURLGenerator $URLGenerator) { |
|
54 | |||
55 | protected function getL10N($languageCode = null) { |
||
58 | |||
59 | /** |
||
60 | * The extension can return an array of additional notification types. |
||
61 | * If no additional types are to be added false is to be returned |
||
62 | * |
||
63 | * @param string $languageCode |
||
64 | * @return array|false |
||
65 | */ |
||
66 | public function getNotificationTypes($languageCode) { |
||
73 | |||
74 | /** |
||
75 | * For a given method additional types to be displayed in the settings can be returned. |
||
76 | * In case no additional types are to be added false is to be returned. |
||
77 | * |
||
78 | * @param string $method |
||
79 | * @return array|false |
||
80 | */ |
||
81 | public function getDefaultTypes($method) { |
||
88 | |||
89 | /** |
||
90 | * A string naming the css class for the icon to be used can be returned. |
||
91 | * If no icon is known for the given type false is to be returned. |
||
92 | * |
||
93 | * @param string $type |
||
94 | * @return string|false |
||
95 | */ |
||
96 | 1 | public function getTypeIcon($type) { |
|
103 | |||
104 | /** |
||
105 | * The extension can translate a given message to the requested languages. |
||
106 | * If no translation is available false is to be returned. |
||
107 | * |
||
108 | * @param string $app |
||
109 | * @param string $text |
||
110 | * @param array $params |
||
111 | * @param boolean $stripPath |
||
112 | * @param boolean $highlightParams |
||
113 | * @param string $languageCode |
||
114 | * @return string|false |
||
115 | */ |
||
116 | public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) { |
||
130 | |||
131 | /** |
||
132 | * The extension can define the type of parameters for translation |
||
133 | * |
||
134 | * Currently known types are: |
||
135 | * * file => will strip away the path of the file and add a tooltip with it |
||
136 | * * username => will add the avatar of the user |
||
137 | * |
||
138 | * @param string $app |
||
139 | * @param string $text |
||
140 | * @return array|false |
||
141 | */ |
||
142 | 1 | public function getSpecialParameterList($app, $text) { |
|
145 | |||
146 | /** |
||
147 | * The extension can define the parameter grouping by returning the index as integer. |
||
148 | * In case no grouping is required false is to be returned. |
||
149 | * |
||
150 | * @param array $activity |
||
151 | * @return integer|false |
||
152 | */ |
||
153 | 1 | public function getGroupParameter($activity) { |
|
156 | |||
157 | /** |
||
158 | * The extension can define additional navigation entries. The array returned has to contain two keys 'top' |
||
159 | * and 'apps' which hold arrays with the relevant entries. |
||
160 | * If no further entries are to be added false is no be returned. |
||
161 | * |
||
162 | * @return array|false |
||
163 | */ |
||
164 | public function getNavigation() { |
||
177 | |||
178 | /** |
||
179 | * The extension can check if a customer filter (given by a query string like filter=abc) is valid or not. |
||
180 | * |
||
181 | * @param string $filterValue |
||
182 | * @return boolean |
||
183 | */ |
||
184 | public function isFilterValid($filterValue) { |
||
187 | |||
188 | /** |
||
189 | * The extension can filter the types based on the filter if required. |
||
190 | * In case no filter is to be applied false is to be returned unchanged. |
||
191 | * |
||
192 | * @param array $types |
||
193 | * @param string $filter |
||
194 | * @return array|false |
||
195 | */ |
||
196 | public function filterNotificationTypes($types, $filter) { |
||
199 | |||
200 | /** |
||
201 | * For a given filter the extension can specify the sql query conditions including parameters for that query. |
||
202 | * In case the extension does not know the filter false is to be returned. |
||
203 | * The query condition and the parameters are to be returned as array with two elements. |
||
204 | * E.g. return array('`app` = ? and `message` like ?', array('mail', 'ownCloud%')); |
||
205 | * |
||
206 | * @param string $filter |
||
207 | * @return array|false |
||
208 | */ |
||
209 | public function getQueryForFilter($filter) { |
||
218 | } |
||
219 |