From c01f196f723dcb3dea6947c821a70d4d80563bbd Mon Sep 17 00:00:00 2001 From: Volkan Gezer Date: Thu, 29 May 2014 21:09:56 +0200 Subject: make reshare settings foldable --- settings/js/admin.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'settings/js') diff --git a/settings/js/admin.js b/settings/js/admin.js index 249131464a8..9353333b47e 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -83,6 +83,9 @@ $(document).ready(function(){ $('#allowLinks').change(function() { $("#publicLinkSettings").toggleClass('hidden', !this.checked); }); + $('#allowResharing').change(function() { + $("#resharingSettings").toggleClass('hidden', !this.checked); + }); $('#security').change(function(){ $.post(OC.filePath('settings','ajax','setsecurity.php'), { enforceHTTPS: $('#forcessl').val() },function(){} ); -- cgit v1.2.3 From ce46cd3680979019de59e48654771f3061076e7b Mon Sep 17 00:00:00 2001 From: raghunayyar Date: Tue, 28 Jan 2014 22:32:51 +0530 Subject: Implements Group Creation from Sidebar --- settings/ajax/creategroup.php | 4 ++-- settings/js/users.js | 41 +++++++++++++++++++++++++++++++++++++++++ settings/templates/users.php | 9 ++++++--- 3 files changed, 49 insertions(+), 5 deletions(-) (limited to 'settings/js') diff --git a/settings/ajax/creategroup.php b/settings/ajax/creategroup.php index 0a79527c219..bd878dc1c0a 100644 --- a/settings/ajax/creategroup.php +++ b/settings/ajax/creategroup.php @@ -7,7 +7,7 @@ $groupname = $_POST["groupname"]; // Does the group exist? if( in_array( $groupname, OC_Group::getGroups())) { - OC_JSON::error(array("data" => array( "message" => $l->t("Group already exists") ))); + OC_JSON::error(array("data" => array( "message" => 'Group already exists' ))); exit(); } @@ -16,5 +16,5 @@ if( OC_Group::createGroup( $groupname )) { OC_JSON::success(array("data" => array( "groupname" => $groupname ))); } else{ - OC_JSON::error(array("data" => array( "message" => $l->t("Unable to add group") ))); + OC_JSON::error(array("data" => array( "message" => 'Unable to add group' ))); } diff --git a/settings/js/users.js b/settings/js/users.js index eef3c237277..7b06d961b1a 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -530,6 +530,47 @@ $(document).ready(function () { } ); }); + $('#newgroup').submit(function (event) { + event.preventDefault(); + var groupname = $('#newgroupname').val(); + if ($.trim(groupname) === '') { + OC.dialogs.alert( + t('settings', 'A valid groupname must be provided'), + t('settings', 'Error creating group')); + return false; + } + $.post( + OC.filePath('settings', 'ajax', 'creategroup.php'), + { + groupname : groupname + }, + function (result) { + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, + t('settings', 'Error creating group')); + } else { + if (result.data.groupname) { + var addedGroups = result.data.groupname; + UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups)); + } + if (result.data.homeExists){ + OC.Notification.hide(); + OC.Notification.show(t('settings', 'Warning: Home directory for user "{group}" already exists', {group: result.data.groupname})); + if (UserList.notificationTimeout){ + window.clearTimeout(UserList.notificationTimeout); + } + UserList.notificationTimeout = window.setTimeout( + function(){ + OC.Notification.hide(); + UserList.notificationTimeout = null; + }, 10000); + } + } + + } + ) + }); + // Handle undo notifications OC.Notification.hide(); $('#notification').on('click', '.undo', function () { diff --git a/settings/templates/users.php b/settings/templates/users.php index a56c7229c1a..83ac79365b6 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -19,8 +19,10 @@ $_['subadmingroups'] = array_flip($items);