diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-27 20:36:34 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-27 20:39:31 -0400 |
commit | 9cd55508c3181ff59080f84a341bd5ecf3e88eab (patch) | |
tree | 35c3874e37d2026244318895151bfc997f6c9636 /settings | |
parent | 2aac6f02a0dd3da73db09e1b23aa14cb84d4d88e (diff) | |
download | nextcloud-server-9cd55508c3181ff59080f84a341bd5ecf3e88eab.tar.gz nextcloud-server-9cd55508c3181ff59080f84a341bd5ecf3e88eab.zip |
Add Share API settings to admin page
Diffstat (limited to 'settings')
-rwxr-xr-x | settings/admin.php | 4 | ||||
-rw-r--r-- | settings/css/settings.css | 3 | ||||
-rw-r--r-- | settings/js/admin.js | 14 | ||||
-rwxr-xr-x | settings/templates/admin.php | 28 |
4 files changed, 48 insertions, 1 deletions
diff --git a/settings/admin.php b/settings/admin.php index 6909e02d14f..8788de940b3 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -30,6 +30,10 @@ $tmpl->assign('entries',$entries); $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking',$htaccessworking); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); +$tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes')); +$tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes')); +$tmpl->assign('allowResharing', OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes')); +$tmpl->assign('sharePolicy', OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global')); $tmpl->assign('forms',array()); foreach($forms as $form){ $tmpl->append('forms',$form); diff --git a/settings/css/settings.css b/settings/css/settings.css index 5a0f5bbde9e..49274103ca8 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -64,4 +64,5 @@ span.version { margin-left:3em; margin-right:3em; color:#555; } span.securitywarning {color:#C33; font-weight:bold; } h3.settingsNotice { font-size: 1.2em; } .settingsNotice { font-weight:bold; padding: 0.5em 0; } -#backgroundjobs input[type=radio] { width:1em; } +input[type=radio] { width:1em; } +table.shareAPI td { padding-right: 2em; }
\ No newline at end of file diff --git a/settings/js/admin.js b/settings/js/admin.js index 57a67b54998..8b1494881a5 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -13,4 +13,18 @@ $(document).ready(function(){ } } }); + + $('#shareAPIEnabled').change(function() { + $('.shareAPI td:not(#enable)').toggle(); + }); + + $('#shareAPI input').change(function() { + if ($(this).attr('type') == 'radio') { + console.log('radio'); + } + if ($(this).attr('type') == 'checkbox') { + console.log('checked'); + } + OC.AppConfig.setValue('core', 'shareapi_', $(this).val()); + }); });
\ No newline at end of file diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 1306d90f402..b701b0e839a 100755 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -35,6 +35,34 @@ if(!$_['htaccessworking']) { <label for="backgroundjobs_cron" title="<?php echo $l->t("use systems cron service"); ?>">Cron</label><br /> </fieldset> +<fieldset class="personalblock" id="shareAPI"> + <legend><strong><?php echo $l->t('Share API');?></strong></legend> + <table class="shareAPI nostyle"> + <tr> + <td id="enable"> + <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" value="1" <?php if ($_['shareAPIEnabled'] == 'yes') echo 'checked="checked"'; ?> /> + <label for="shareAPIEnabled"><?php echo $l->t('Enable Share API');?></label><br /> + <em><?php echo $l->t('Allow apps to use the Share API'); ?></em> + </td> + <td <?php if ($_['shareAPIEnabled'] == 'no') echo 'style="display:none"';?>> + <input type="checkbox" name="shareapi_allow_links" id="allowLinks" value="1" <?php if ($_['allowLinks'] == 'yes') echo 'checked="checked"'; ?> /> + <label for="allowLinks"><?php echo $l->t('Allow links');?></label><br /> + <em><?php echo $l->t('Allow users to share items to the public with links'); ?></em> + </td> + <td <?php if ($_['shareAPIEnabled'] == 'no') echo 'style="display:none"';?>> + <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" value="1" <?php if ($_['allowResharing'] == 'yes') echo 'checked="checked"'; ?> /> + <label for="allowResharing"><?php echo $l->t('Allow resharing');?></label><br /> + <em><?php echo $l->t('Allow users to share items shared with them again'); ?></em> + <td <?php if ($_['shareAPIEnabled'] == 'no') echo 'style="display:none"';?>> + <input type="radio" name="shareapi_share_policy" id="sharePolicyGlobal" value="global" <?php if ($_['sharePolicy'] == 'global') echo 'checked="checked"'; ?> /> + <label for="sharePolicyGlobal"><?php echo $l->t('Allow users to share with anyone'); ?></label><br /> + <input type="radio" name="shareapi_share_policy" id="sharePolicyGroupsOnly" value="groups_only" <?php if ($_['sharePolicy'] == 'groups_only') echo 'checked="checked"'; ?> /> + <label for="sharePolicyGroupsOnly"><?php echo $l->t('Allow users to only share with users in their groups');?></label><br /> + </td> + </tr> + </table> +</fieldset> + <fieldset class="personalblock"> <legend><strong><?php echo $l->t('Log');?></strong></legend> Log level: <select name='loglevel' id='loglevel'> |