Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-03-13 22:25:22 +0300
committerJulius Härtl <jus@bitgrid.net>2019-03-19 15:06:55 +0300
commit403b673b93b98b7158838c232581ad221aeccd09 (patch)
treea1ae79fa9ab7d91bf6fb6acc14da81a5b36aef8f /apps
parentff6f105ea6a37107e7c6e12bcace010490c93c58 (diff)
Replace the icon-class with an absolute link to an image
Otherwise the icon can not be displayed in mobile apps Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/Collaboration/Resources/ResourceProvider.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/files/lib/Collaboration/Resources/ResourceProvider.php b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
index d29b18afea3..27b155b7641 100644
--- a/apps/files/lib/Collaboration/Resources/ResourceProvider.php
+++ b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
*
@@ -24,7 +25,6 @@ namespace OCA\Files\Collaboration\Resources;
use OCP\Collaboration\Resources\IProvider;
use OCP\Collaboration\Resources\IResource;
-use OCP\Collaboration\Resources\ResourceException;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\IURLGenerator;
@@ -65,7 +65,7 @@ class ResourceProvider implements IProvider {
*
* @param IResource $resource
* @return string
- * @since 15.0.0
+ * @since 16.0.0
*/
public function getName(IResource $resource): string {
if (isset($this->nodes[(int) $resource->getId()])) {
@@ -84,7 +84,7 @@ class ResourceProvider implements IProvider {
* @param IResource $resource
* @param IUser $user
* @return bool
- * @since 15.0.0
+ * @since 16.0.0
*/
public function canAccessResource(IResource $resource, IUser $user = null): bool {
if (!$user instanceof IUser) {
@@ -107,21 +107,25 @@ class ResourceProvider implements IProvider {
*
* @param IResource $resource
* @return string
- * @since 15.0.0
+ * @since 16.0.0
*/
- public function getIconClass(IResource $resource): string {
+ public function getIconLink(IResource $resource): string {
$node = $this->getNode($resource);
if ($node && $node->getMimetype() === 'httpd/unix-directory') {
- return 'icon-files-dark';
+ return $this->urlGenerator->getAbsoluteURL(
+ $this->urlGenerator->imagePath('core', 'places/files')
+ );
}
- return 'icon-filetype-file';
+ return $this->urlGenerator->getAbsoluteURL(
+ $this->urlGenerator->imagePath('core', 'filetypes/file')
+ );
}
/**
* Get the resource type of the provider
*
* @return string
- * @since 15.0.0
+ * @since 16.0.0
*/
public function getType(): string {
return self::RESOURCE_TYPE;
@@ -132,7 +136,7 @@ class ResourceProvider implements IProvider {
*
* @param IResource $resource
* @return string
- * @since 15.0.0
+ * @since 16.0.0
*/
public function getLink(IResource $resource): string {
return $this->urlGenerator->linkToRoute('files.viewcontroller.showFile', ['fileid' => $resource->getId()]);