diff --git a/apps/files_sharing/templates/settings-admin.php b/apps/files_sharing/templates/settings-admin.php index 9fac97faf55dbfe4913f83c6652caa59c9e7a752..bd8035175970565cfc12554ab671ab4c73e18e6b 100644 --- a/apps/files_sharing/templates/settings-admin.php +++ b/apps/files_sharing/templates/settings-admin.php @@ -2,20 +2,22 @@ /** @var OC_L10N $l */ /** @var array $_ */ ?> -<div class="section" id="fileSharingSettings" > +<div id="fileSharingSettings"> + <h3><?php p($l->t('Federated Cloud Sharing'));?></h3> - <h2><?php p($l->t('Federated Cloud Sharing'));?></h2> - - <input type="checkbox" name="outgoing_server2server_share_enabled" id="outgoingServer2serverShareEnabled" - value="1" <?php if ($_['outgoingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> - <label for="outgoingServer2serverShareEnabled"> - <?php p($l->t('Allow users on this server to send shares to other servers'));?> - </label><br/> - - <input type="checkbox" name="incoming_server2server_share_enabled" id="incomingServer2serverShareEnabled" - value="1" <?php if ($_['incomingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> - <label for="incomingServer2serverShareEnabled"> - <?php p($l->t('Allow users on this server to receive shares from other servers'));?> - </label><br/> + <p> + <input type="checkbox" name="outgoing_server2server_share_enabled" id="outgoingServer2serverShareEnabled" + value="1" <?php if ($_['outgoingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> + <label for="outgoingServer2serverShareEnabled"> + <?php p($l->t('Allow users on this server to send shares to other servers'));?> + </label> + </p> + <p> + <input type="checkbox" name="incoming_server2server_share_enabled" id="incomingServer2serverShareEnabled" + value="1" <?php if ($_['incomingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> + <label for="incomingServer2serverShareEnabled"> + <?php p($l->t('Allow users on this server to receive shares from other servers'));?> + </label><br/> + </p> </div> diff --git a/core/css/apps.css b/core/css/apps.css index 2bac961d36f3cfbeb42ea631a61a3f39cbcb5c2b..e8c60bd4773179d71e15a170ddf59f3e293a4cf6 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -500,8 +500,9 @@ button.loading { font-weight: normal; } .section h3 { - font-size: 16px; + font-size: 15px; font-weight: normal; + margin: 12px 0; } /* slight position correction of checkboxes and radio buttons */ .section input[type="checkbox"], diff --git a/settings/admin.php b/settings/admin.php index 4416af1fe375acb03459b3f0837847edfdfc4461..95afaf1ac0a54c2f905cca6c7e73dd133c1d129b 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -135,6 +135,33 @@ if ($request->getServerProtocol() !== 'https' || !OC_Util::isAnnotationsWorking ) { $formsAndMore[] = array('anchor' => 'security-warning', 'section-name' => $l->t('Security & setup warnings')); } +$formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing')); + +// Prioritize fileSharingSettings and files_external and move updater to the version +$fileSharingSettings = $filesExternal = $updaterAppPanel = ''; +foreach ($forms as $index => $form) { + if (strpos($form, 'id="fileSharingSettings"')) { + $fileSharingSettings = $form; + unset($forms[$index]); + continue; + } + if (strpos($form, 'id="files_external"')) { + $filesExternal = $form; + unset($forms[$index]); + continue; + } + if (strpos($form, 'class="updater-admin"')) { + $updaterAppPanel = $form; + unset($forms[$index]); + continue; + } +} +if ($filesExternal) { + $formsAndMore[] = array('anchor' => 'files_external', 'section-name' => $l->t('External Storage')); +} +$template->assign('fileSharingSettings', $fileSharingSettings); +$template->assign('filesExternal', $filesExternal); +$template->assign('updaterAppPanel', $updaterAppPanel); $formsMap = array_map(function ($form) { if (preg_match('%(<h2[^>]*>.*?</h2>)%i', $form, $regs)) { @@ -158,11 +185,12 @@ $formsAndMore = array_merge($formsAndMore, $formsMap); // add bottom hardcoded forms from the template $formsAndMore[] = array('anchor' => 'backgroundjobs', 'section-name' => $l->t('Cron')); -$formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing')); -$formsAndMore[] = array('anchor' => 'encryptionAPI', 'section-name' => $l->t('Server Side Encryption')); $formsAndMore[] = array('anchor' => 'mail_general_settings', 'section-name' => $l->t('Email Server')); $formsAndMore[] = array('anchor' => 'log-section', 'section-name' => $l->t('Log')); $formsAndMore[] = array('anchor' => 'admin-tips', 'section-name' => $l->t('Tips & tricks')); +if ($updaterAppPanel) { + $formsAndMore[] = array('anchor' => 'updater', 'section-name' => $l->t('Updates')); +} $template->assign('forms', $formsAndMore); diff --git a/settings/js/admin.js b/settings/js/admin.js index d1dc23382f9dad329052d5e6a431636e450e9ccf..1e27c1be7e3089d66a5d48b4cfab98f282f81495 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -117,9 +117,9 @@ $(document).ready(function(){ } }); - $('#mail_general_settings').change(function(){ + $('#mail_general_settings_form').change(function(){ OC.msg.startSaving('#mail_settings_msg'); - var post = $( "#mail_general_settings" ).serialize(); + var post = $( "#mail_general_settings_form" ).serialize(); $.post(OC.generateUrl('/settings/admin/mailsettings'), post, function(data){ OC.msg.finishedSaving('#mail_settings_msg', data); }); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index c49800d97beb9809a33ab64465e2c45d31f2126a..1b0ed66563e5780443c15d97cbb9cce57a44fe8b 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -168,6 +168,77 @@ if ($_['cronErrors']) { </div> </div> + <div class="section" id="shareAPI"> + <h2><?php p($l->t('Sharing'));?></h2> + <p id="enable"> + <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" + value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_allow_links" id="allowLinks" + value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> + </p> + + <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> + <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" + value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> /> + <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/> + + <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" + value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/> + + <input type="checkbox" name="shareapi_allow_public_notification" id="allowPublicMailNotification" + value="1" <?php if ($_['allowPublicMailNotification'] == 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowPublicMailNotification"><?php p($l->t('Allow users to send mail notification for shared files'));?></label><br/> + + <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" + value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/> + + </p> + <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <?php p($l->t( 'Expire after ' )); ?> + <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>" + value='<?php p($_['shareExpireAfterNDays']) ?>' /> + <?php p($l->t( 'days' )); ?> + <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" + value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" + value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" + value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> + <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_allow_mail_notification" id="allowMailNotification" + value="1" <?php if ($_['allowMailNotification'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="allowMailNotification"><?php p($l->t('Allow users to send mail notification for shared files to other users'));?></label><br/> + </p> + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> + <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" + value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> + <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> + </p> + <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> + <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px"/> + <br /> + <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em> + </p> + + <?php print_unescaped($_['fileSharingSettings']); ?> + </div> + +<?php print_unescaped($_['filesExternal']); ?> + <?php foreach($_['forms'] as $form) { if (isset($form['form'])) {?> <div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div> @@ -315,8 +386,8 @@ if ($_['cronErrors']) { </div> </div> -<div class="section"> - <form id="mail_general_settings" class="mail_settings"> +<div class="section" id="mail_general_settings"> + <form id="mail_general_settings_form" class="mail_settings"> <h2><?php p($l->t('Email Server'));?></h2> <p><?php p($l->t('This is used for sending out notifications.')); ?> <span id="mail_settings_msg" class="msg"></span></p> @@ -478,6 +549,10 @@ if ($_['cronErrors']) { <?php include('settings.development.notice.php'); ?> </div> +<?php if (!empty($_['updaterAppPanel'])): ?> + <div id="updater"><?php print_unescaped($_['updaterAppPanel']); ?></div> +<?php endif; ?> + <div class="section credits-footer"> <p><?php print_unescaped($theme->getShortFooter()); ?></p> </div>