]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix undefined index errors if public share view
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 21 Nov 2013 11:02:09 +0000 (12:02 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 21 Nov 2013 11:03:27 +0000 (12:03 +0100)
apps/files/templates/index.php
apps/files_sharing/public.php

index 6dd28532ccba278452f8747cd9f128c251b4ff7a..bf57790684292e7457bb8a4ca1a0b9451409fee1 100644 (file)
@@ -25,7 +25,7 @@
                                                   data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
                                        <a href="#" class="svg"></a>
                        </div>
-                       <?php if ($_['trash'] ): ?>
+                       <?php if (!$_['isPublic'] && $_['trash'] ): ?>
                        <input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?>></input>
                        <?php endif; ?>
                        <div id="uploadprogresswrapper">
 <input type="hidden" name="ajaxLoad" id="ajaxLoad" value="<?php p($_['ajaxLoad']); ?>" />
 <input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />
 <input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" />
+<?php if (!$_['isPublic']) :?>
 <input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />
 <input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" />
 <input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />
 <input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
-
+<?php endif;
index d59f9b7401a4880a69ada39633da1b9fd72c6ada..99b74da6a1a978d19ecd03ab4ffd7cef4e4609d3 100644 (file)
@@ -221,6 +221,8 @@ if (isset($path)) {
                        $breadcrumbNav->assign('breadcrumb', $breadcrumb);
                        $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
                        $maxUploadFilesize=OCP\Util::maxUploadFilesize($path);
+                       $fileHeader = (!isset($files) or count($files) > 0);
+                       $emptyContent = ($allowPublicUploadEnabled and !$fileHeader);
                        $folder = new OCP\Template('files', 'index', '');
                        $folder->assign('fileList', $list->fetchPage());
                        $folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
@@ -234,6 +236,10 @@ if (isset($path)) {
                        $folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
                        $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
                        $folder->assign('usedSpacePercent', 0);
+                       $folder->assign('fileHeader', $fileHeader);
+                       $folder->assign('disableSharing', true);
+                       $folder->assign('emptyContent', $emptyContent);
+                       $folder->assign('ajaxLoad', false);
                        $tmpl->assign('folder', $folder->fetchPage());
                        $maxInputFileSize = OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB'));
                        $allowZip = OCP\Config::getSystemValue('allowZipDownload', true)