1 | <?php |
||
30 | class FilesHooksStatic { |
||
31 | /** |
||
32 | * Registers the filesystem hooks for basic filesystem operations. |
||
33 | * All other events has to be triggered by the apps. |
||
34 | */ |
||
35 | 1 | public static function register() { |
|
36 | 1 | Util::connectHook('OC_Filesystem', 'post_create', 'OCA\Activity\FilesHooksStatic', 'fileCreate'); |
|
37 | 1 | Util::connectHook('OC_Filesystem', 'post_update', 'OCA\Activity\FilesHooksStatic', 'fileUpdate'); |
|
38 | 1 | Util::connectHook('OC_Filesystem', 'delete', 'OCA\Activity\FilesHooksStatic', 'fileDelete'); |
|
39 | 1 | Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', 'OCA\Activity\FilesHooksStatic', 'fileRestore'); |
|
40 | 1 | Util::connectHook('OCP\Share', 'post_shared', 'OCA\Activity\FilesHooksStatic', 'share'); |
|
41 | |||
42 | 1 | $eventDispatcher = \OC::$server->getEventDispatcher(); |
|
43 | 1 | $eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', ['OCA\Activity\FilesHooksStatic', 'onLoadFilesAppScripts']); |
|
44 | 1 | } |
|
45 | |||
46 | /** |
||
47 | * @return FilesHooks |
||
48 | */ |
||
49 | static protected function getHooks() { |
||
53 | |||
54 | /** |
||
55 | * Store the create hook events |
||
56 | * @param array $params The hook params |
||
57 | */ |
||
58 | public static function fileCreate($params) { |
||
61 | |||
62 | /** |
||
63 | * Store the update hook events |
||
64 | * @param array $params The hook params |
||
65 | */ |
||
66 | public static function fileUpdate($params) { |
||
69 | |||
70 | /** |
||
71 | * Store the delete hook events |
||
72 | * @param array $params The hook params |
||
73 | */ |
||
74 | public static function fileDelete($params) { |
||
77 | |||
78 | /** |
||
79 | * Store the restore hook events |
||
80 | * @param array $params The hook params |
||
81 | */ |
||
82 | public static function fileRestore($params) { |
||
85 | |||
86 | /** |
||
87 | * Manage sharing events |
||
88 | * @param array $params The hook params |
||
89 | */ |
||
90 | public static function share($params) { |
||
93 | |||
94 | /** |
||
95 | * Load additional scripts when the files app is visible |
||
96 | */ |
||
97 | public static function onLoadFilesAppScripts() { |
||
105 | } |
||
106 |