diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-04-09 14:54:57 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-04-09 14:54:57 +0200 |
commit | b9eaa386c4f72fcf6e347a92886897b537ade6e6 (patch) | |
tree | adc8d01364d84587faa79baa5b8d79f1627a31c7 /core/js | |
parent | 0710db77bc59e296309e24773ffa6e77ef22991a (diff) | |
parent | 6f51beac23c48384103457c26cda71a7c7f42fc1 (diff) | |
download | nextcloud-server-b9eaa386c4f72fcf6e347a92886897b537ade6e6.tar.gz nextcloud-server-b9eaa386c4f72fcf6e347a92886897b537ade6e6.zip |
Merge pull request #15235 from owncloud/remote-share-hint
Hint for remote sharing syntax
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/config.php | 10 | ||||
-rw-r--r-- | core/js/share.js | 17 |
2 files changed, 23 insertions, 4 deletions
diff --git a/core/js/config.php b/core/js/config.php index b57289fde48..d6946f671d1 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -50,14 +50,16 @@ foreach(OC_App::getEnabledApps() as $app) { $apps_paths[$app] = OC_App::getAppWebPath($app); } -$value = \OCP\Config::getAppValue('core', 'shareapi_default_expire_date', 'no'); +$config = \OC::$server->getConfig(); +$value = $config->getAppValue('core', 'shareapi_default_expire_date', 'no'); $defaultExpireDateEnabled = ($value === 'yes') ? true :false; $defaultExpireDate = $enforceDefaultExpireDate = null; if ($defaultExpireDateEnabled) { - $defaultExpireDate = (int)\OCP\Config::getAppValue('core', 'shareapi_expire_after_n_days', '7'); - $value = \OCP\Config::getAppValue('core', 'shareapi_enforce_expire_date', 'no'); + $defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); + $value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); $enforceDefaultExpireDate = ($value === 'yes') ? true : false; } +$outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', @@ -110,6 +112,8 @@ $array = array( 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), + 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, + 'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated') ) ) ), diff --git a/core/js/share.js b/core/js/share.js index b9b4a5bc754..5018d10ee9c 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -391,8 +391,18 @@ OC.Share={ } }); + var sharePlaceholder = t('core', 'Share with users or groups …'); + if(oc_appconfig.core.remoteShareAllowed) { + sharePlaceholder = t('core', 'Share with users, groups or remote users …'); + } + html += '<label for="shareWith" class="hidden-visually">'+t('core', 'Share')+'</label>'; - html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with user or group …')+'" />'; + html += '<input id="shareWith" type="text" placeholder="' + sharePlaceholder + '" />'; + if(oc_appconfig.core.remoteShareAllowed) { + var federatedCloudSharingDoc = '<a target="_blank" class="icon-info svg shareWithRemoteInfo" href="{docLink}" ' + + 'title="' + t('core', 'Share with people on other ownClouds using the syntax username@example.com/owncloud') + '"></a>'; + html += federatedCloudSharingDoc.replace('{docLink}', oc_appconfig.core.federatedCloudShareDoc); + } html += '<span class="shareWithLoading icon-loading-small hidden"></span>'; html += '<ul id="shareWithList">'; html += '</ul>'; @@ -443,6 +453,11 @@ OC.Share={ dropDownEl = $(html); dropDownEl = dropDownEl.appendTo(appendTo); + // trigger remote share info tooltip + if(oc_appconfig.core.remoteShareAllowed) { + $('.shareWithRemoteInfo').tipsy({gravity: 'e'}); + } + //Get owner avatars if (oc_config.enable_avatars === true && data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) { dropDownEl.find(".avatar").avatar(data.reshare.uid_owner, 32); |