1 | <?php |
||
27 | class Storage { |
||
28 | const MIMETYPE_LIBREOFFICE_WORDPROCESSOR = 'application/vnd.oasis.opendocument.text'; |
||
29 | private static $SUPPORTED_MIMES_READ = array( |
||
30 | 'application/vnd.oasis.opendocument.spreadsheet', |
||
31 | 'application/vnd.oasis.opendocument.presentation', |
||
32 | 'application/vnd.oasis.opendocument.graphics', |
||
33 | ); |
||
34 | |||
35 | public static function getDocuments() { |
||
36 | $list = array_filter( |
||
37 | self::searchDocuments(), |
||
38 | function($item){ |
||
39 | //filter Deleted |
||
40 | if (strpos($item['path'], '_trashbin')===0){ |
||
41 | return false; |
||
42 | } |
||
43 | return true; |
||
44 | } |
||
45 | ); |
||
46 | |||
47 | return $list; |
||
48 | } |
||
49 | |||
50 | public static function resolvePath($fileId){ |
||
51 | $list = array_filter( |
||
52 | self::searchDocuments(), |
||
53 | function($item) use ($fileId){ |
||
54 | return intval($item['fileid'])==$fileId; |
||
55 | } |
||
56 | ); |
||
57 | if (count($list)>0){ |
||
58 | $item = current($list); |
||
59 | return $item['path']; |
||
60 | } |
||
61 | return false; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @brief Cleanup session data on removing the document |
||
66 | * @param array |
||
67 | * |
||
68 | * This function is connected to the delete signal of OC_Filesystem |
||
69 | * to delete the related info from database |
||
70 | */ |
||
71 | public static function onDelete($params) { |
||
96 | |||
97 | protected static function searchDocuments(){ |
||
106 | |||
107 | public static function getSupportedMimetypes(){ |
||
114 | } |
||
115 |