]> source.dussan.org Git - nextcloud-server.git/commitdiff
Hiding add to your own cloud if server2server sharing is not enabled
authorClark Tomlinson <fallen013@gmail.com>
Wed, 3 Sep 2014 14:00:01 +0000 (10:00 -0400)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 13 Nov 2014 21:45:00 +0000 (22:45 +0100)
apps/files_sharing/public.php
apps/files_sharing/templates/public.php

index 2b84cd3cc3c062af8c2f6d7abb7ea445f88bd8e7..8794e4a69d497623462701570d95fa0f1790f5c1 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 // Load other apps for file previews
+use OCA\Files_Sharing\Helper;
+
 OC_App::loadApps();
 
 $appConfig = \OC::$server->getAppConfig();
@@ -132,6 +134,7 @@ if (isset($path)) {
                $tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
                $tmpl->assign('dirToken', $linkItem['token']);
                $tmpl->assign('sharingToken', $token);
+               $tmpl->assign('server2serversharing', Helper::isOutgoingServer2serverShareEnabled());
                $tmpl->assign('protected', isset($linkItem['share_with']) ? 'true' : 'false');
 
                $urlLinkIdentifiers= (isset($token)?'&t='.$token:'')
index 21fb611548b543e6b79d89a3aa264a72425c3526..46bf90b1b4128e587f0378528ff2248c86334f4c 100644 (file)
@@ -30,13 +30,18 @@ $previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'fals
                <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
                <div class="header-right">
                        <span id="details">
-                               <span id="save" data-protected="<?php p($_['protected'])?>" data-owner="<?php p($_['displayName'])?>" data-name="<?php p($_['filename'])?>">
+                               <?php
+                               if ($_['server2serversharing']) {
+                                       ?>
+                                       <span id="save" data-protected="<?php p($_['protected']) ?>"
+                                                 data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>">
                                        <button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button>
                                        <form class="save-form hidden" action="#">
                                                <input type="text" id="remote_address" placeholder="example.com/owncloud"/>
                                                <button id="save-button-confirm" class="icon-confirm svg"></button>
                                        </form>
                                </span>
+                               <?php } ?>
                                <a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
                                        <img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
                                        <span id="download-text"><?php p($l->t('Download'))?></span>