diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-01-15 14:36:18 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-01-15 14:36:18 +0100 |
commit | 807b885a0e83841b51b694afbb4b377e39215b0f (patch) | |
tree | dad2aeaddaf49d23dc82d0b47e17584db7ff5cd2 | |
parent | 072ef7f010ca9f48119bc2397a82fdd0aac76beb (diff) | |
download | nextcloud-server-807b885a0e83841b51b694afbb4b377e39215b0f.tar.gz nextcloud-server-807b885a0e83841b51b694afbb4b377e39215b0f.zip |
reuse file upload as used within files app - remove public upload button
-rw-r--r-- | apps/files/templates/index.php | 8 | ||||
-rw-r--r-- | apps/files_sharing/public.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 54 |
3 files changed, 10 insertions, 55 deletions
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 00ec109621f..d7f479b504f 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -18,6 +18,10 @@ <input type="hidden" name="MAX_FILE_SIZE" id="max_upload" value="<?php p($_['uploadMaxFilesize']) ?>"> <?php endif;?> + <?php if(isset($_['dirToken'])):?> + <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> + <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" /> + <?php endif;?> <input type="hidden" class="max_human_file_size" value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)"> <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir"> @@ -26,7 +30,7 @@ <a href="#" class="svg"></a> </div> <?php if ($_['trash']): ?> - <input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?>></input> + <input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?>> <?php endif; ?> <div id="uploadprogresswrapper"> <div id="uploadprogressbar"></div> @@ -44,7 +48,7 @@ <div id="emptycontent" <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div> -<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input> +<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"> <table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36"> <thead> diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index ae0a62f1034..e3d68955439 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -225,7 +225,8 @@ if (isset($path)) { $folder->assign('fileList', $list->fetchPage()); $folder->assign('breadcrumb', $breadcrumbNav->fetchPage()); $folder->assign('dir', $getPath); - $folder->assign('isCreatable', false); + $folder->assign('isCreatable', $allowPublicUploadEnabled); + $folder->assign('dirToken', $linkItem['token']); $folder->assign('permissions', OCP\PERMISSION_READ); $folder->assign('isPublic',true); $folder->assign('publicUploadEnabled', 'no'); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 1d527dca8eb..d82e567182a 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -14,57 +14,7 @@ src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a> <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> <div class="header-right"> - <?php if (isset($_['folder'])): ?> - <span id="details"><?php p($l->t('%s shared the folder %s with you', - array($_['displayName'], $_['filename']))) ?></span> - <?php else: ?> - <span id="details"><?php p($l->t('%s shared the file %s with you', - array($_['displayName'], $_['filename']))) ?></span> - <?php endif; ?> - - - <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> - <a href="<?php p($_['downloadURL']); ?>" class="button" id="download"><img - class="svg" alt="Download" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" - /><span><?php p($l->t('Download'))?></span></a> - <?php endif; ?> - - <?php if ($_['allowPublicUploadEnabled']):?> - - - <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> - <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" /> - <input type="hidden" id="uploadMaxFilesize" name="uploadMaxFilesize" value="<?php p($_['uploadMaxFilesize']) ?>" /> - <input type="hidden" id="uploadMaxHumanFilesize" name="uploadMaxHumanFilesize" value="<?php p($_['uploadMaxHumanFilesize']) ?>" /> - <input type="hidden" id="directory_path" name="directory_path" value="<?php p($_['directory_path']) ?>" /> - <?php if($_['uploadMaxFilesize'] >= 0):?> - <input type="hidden" name="MAX_FILE_SIZE" id="max_upload" - value="<?php p($_['uploadMaxFilesize']) ?>"> - <?php endif;?> - - - <div id="data-upload-form" class="button" title="<?php p($l->t('Upload') . ' max. '.$_['uploadMaxHumanFilesize']) ?>"> - <input id="file_upload_start" type="file" name="files[]" data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" multiple> - <a href="#" id="publicUploadButtonMock" class="svg"> - <span><?php p($l->t('Upload'))?></span> - </a> - </div> - - </div> - - <div id="additional_controls" style="display:none"> - <div id="uploadprogresswrapper"> - <div id="uploadprogressbar"></div> - <input id="cancel_upload_button" type="button" class="stop" style="display:none" - value="<?php p($l->t('Cancel upload'));?>" - /> - </div> - - - - - <?php endif; ?> - + <span id="details"><?php p($l->t('shared by %s', array($_['displayName']))) ?></span> </div> </div></header> <div id="content"> @@ -96,7 +46,7 @@ </li> </ul> <?php endif; ?> - <div class="directLink"><label for="directLink"><?php p($l->t('Direct link')) ?></label><input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>"></input></div> + <div class="directLink"><label for="directLink"><?php p($l->t('Direct link')) ?></label><input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>"></div> <?php endif; ?> </div> <footer> |