$list->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=');
$list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/')));
$list->assign('disableSharing', false);
+$list->assign('isPublic', false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb);
$breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=');
<?php if($file['type'] == 'dir'): ?>
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)"
<?php else: ?>
- style="background-image:url(<?php print_unescaped(OCP\preview_icon($relativePath)); ?>)"
+ <?php if($_['isPublic']): ?>
+ <?php
+ $relativePath = substr($relativePath, strlen($_['sharingroot']));
+ ?>
+ style="background-image:url(<?php print_unescaped(OCP\publicPreview_icon($relativePath, $_['sharingtoken'])); ?>)"
+ <?php else: ?>
+ style="background-image:url(<?php print_unescaped(OCP\preview_icon($relativePath)); ?>)"
+ <?php endif; ?>
<?php endif; ?>
>
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
$list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
$list->assign('downloadURL',
OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=');
+ $list->assign('isPublic', true);
+ $list->assign('sharingtoken', $token);
+ $list->assign('sharingroot', ($path));
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
return self::linkToRoute( 'core_ajax_preview', array('x' => 44, 'y' => 44, 'file' => urlencode($path) ));
}
+ public static function publicPreview_icon( $path, $token ) {
+ return self::linkToRoute( 'core_ajax_public_preview', array('x' => 44, 'y' => 44, 'file' => urlencode($path), 't' => $token));
+ }
+
/**
* @brief Make a human file size
* @param int $bytes file size in bytes
return(\preview_icon( $path ));
}
+/**
+ * @brief make publicpreview_icon available as a simple function
+ * Returns the path to the preview of the image.
+ * @param $path path of file
+ * @returns link to the preview
+ */
+function publicPreview_icon ( $path, $token ) {
+ return(\publicPreview_icon( $path, $token ));
+}
+
/**
* @brief make OC_Helper::humanFileSize available as a simple function
* Makes 2048 to 2 kB.
return OC_Helper::previewIcon( $path );
}
+function publicPreview_icon ( $path, $token ) {
+ return OC_Helper::publicPreview_icon( $path, $token );
+}
+
/**
* @brief make OC_Helper::mimetypeIcon available as a simple function
* @param string $mimetype mimetype