use \OC::$server->getPreviewManager() instead of \OCP\Preview
This commit is contained in:
parent
b9e943f5d5
commit
9b420e8660
|
@ -26,7 +26,7 @@ $files = array();
|
||||||
if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) {
|
if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) {
|
||||||
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, 'httpd/unix-directory' ) as $file ) {
|
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, 'httpd/unix-directory' ) as $file ) {
|
||||||
$file['directory'] = $dir;
|
$file['directory'] = $dir;
|
||||||
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
|
$file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']);
|
||||||
$file["date"] = OCP\Util::formatDate($file["mtime"]);
|
$file["date"] = OCP\Util::formatDate($file["mtime"]);
|
||||||
$file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
|
$file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
|
||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
|
@ -37,7 +37,7 @@ if (is_array($mimetypes) && count($mimetypes)) {
|
||||||
foreach ($mimetypes as $mimetype) {
|
foreach ($mimetypes as $mimetype) {
|
||||||
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, $mimetype ) as $file ) {
|
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, $mimetype ) as $file ) {
|
||||||
$file['directory'] = $dir;
|
$file['directory'] = $dir;
|
||||||
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
|
$file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']);
|
||||||
$file["date"] = OCP\Util::formatDate($file["mtime"]);
|
$file["date"] = OCP\Util::formatDate($file["mtime"]);
|
||||||
$file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
|
$file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
|
||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
|
@ -46,7 +46,7 @@ if (is_array($mimetypes) && count($mimetypes)) {
|
||||||
} else {
|
} else {
|
||||||
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $file ) {
|
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $file ) {
|
||||||
$file['directory'] = $dir;
|
$file['directory'] = $dir;
|
||||||
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
|
$file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']);
|
||||||
$file["date"] = OCP\Util::formatDate($file["mtime"]);
|
$file["date"] = OCP\Util::formatDate($file["mtime"]);
|
||||||
$file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
|
$file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
|
||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Helper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i['directory'] = $dir;
|
$i['directory'] = $dir;
|
||||||
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']);
|
$i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']);
|
||||||
$i['icon'] = \OCA\files\lib\Helper::determineIcon($i);
|
$i['icon'] = \OCA\files\lib\Helper::determineIcon($i);
|
||||||
$files[] = $i;
|
$files[] = $i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ if (isset($path)) {
|
||||||
} else {
|
} else {
|
||||||
$i['extension'] = '';
|
$i['extension'] = '';
|
||||||
}
|
}
|
||||||
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']);
|
$i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']);
|
||||||
}
|
}
|
||||||
$i['directory'] = $getPath;
|
$i['directory'] = $getPath;
|
||||||
$i['permissions'] = OCP\PERMISSION_READ;
|
$i['permissions'] = OCP\PERMISSION_READ;
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Helper
|
||||||
$i['directory'] = '';
|
$i['directory'] = '';
|
||||||
}
|
}
|
||||||
$i['permissions'] = \OCP\PERMISSION_READ;
|
$i['permissions'] = \OCP\PERMISSION_READ;
|
||||||
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($r['mime']);
|
$i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($r['mime']);
|
||||||
$i['icon'] = \OCA\files\lib\Helper::determineIcon($i);
|
$i['icon'] = \OCA\files\lib\Helper::determineIcon($i);
|
||||||
$files[] = $i;
|
$files[] = $i;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue