]> source.dussan.org Git - nextcloud-server.git/commitdiff
reuse file upload as used within files app - remove public upload button
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 15 Jan 2014 13:36:18 +0000 (14:36 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 15 Jan 2014 13:36:18 +0000 (14:36 +0100)
apps/files/templates/index.php
apps/files_sharing/public.php
apps/files_sharing/templates/public.php

index 00ec109621f0e3c17cb83ea60bee7e55ae4ad2e0..d7f479b504fbe542cec2d1b9a0b7613d10dc13a8 100644 (file)
                                        <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>
index ae0a62f1034441eb11dbaa96a9003e0b62fe6bc0..e3d689554399484be988e21161292396a89a0702 100644 (file)
@@ -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');
index 1d527dca8eb362532d51ef02d141a5bb0655eb82..d82e567182a63c3b7de3bb5caf47b1ac07cc689d 100644 (file)
                                                                                                          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>