commit
10ae3039ca
@ -10,7 +10,7 @@
|
|||||||
<repository type="git">https://github.com/owncloud/richdocuments.git</repository>
|
<repository type="git">https://github.com/owncloud/richdocuments.git</repository>
|
||||||
<category>productivity</category>
|
<category>productivity</category>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<owncloud min-version="8.2" max-version="8.2" />
|
<owncloud min-version="8.2" max-version="9.0" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<public>
|
<public>
|
||||||
<richdocuments>public.php</richdocuments>
|
<richdocuments>public.php</richdocuments>
|
||||||
|
@ -139,11 +139,29 @@ class Storage {
|
|||||||
Db\Session::cleanUp($session->getEsId());
|
Db\Session::cleanUp($session->getEsId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function processDocuments($rawDocuments){
|
||||||
|
$documents = array();
|
||||||
|
foreach($rawDocuments as $rawDocument){
|
||||||
|
$document = array(
|
||||||
|
'fileid' => $rawDocument->getId(),
|
||||||
|
'path' => $rawDocument->getInternalPath(),
|
||||||
|
'name' => $rawDocument->getName(),
|
||||||
|
'mimetype' => $rawDocument->getMimetype()
|
||||||
|
);
|
||||||
|
|
||||||
|
array_push($documents, $document);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $documents;
|
||||||
|
}
|
||||||
|
|
||||||
protected static function searchDocuments(){
|
protected static function searchDocuments(){
|
||||||
$documents = array();
|
$documents = array();
|
||||||
foreach (self::getSupportedMimetypes() as $mime){
|
foreach (self::getSupportedMimetypes() as $mime){
|
||||||
$documents = array_merge($documents, \OCP\Files::searchByMime($mime));
|
$rawDocuments = \OCP\Files::searchByMime($mime);
|
||||||
|
$documents = array_merge($documents, self::processDocuments($rawDocuments));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $documents;
|
return $documents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user