+++ /dev/null
-<?php
-
-OCP\JSON::callCheck();
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAdminUser();
-
-$l=OC_L10N::get('settings');
-
-$groupname = $_POST["groupname"];
-
-// Return Success story
-// TODO : make changes to the API to allow this.
-// setGroupname doesnt exist yet.
-if(OC_Group::setGroupname($groupname)) {
- OCP\JSON::success(
- array("data" => array(
- "message" => $l->t('Group name has been changed.'),
- "groupname" => $groupname,
- )
- )
- );
-} else {
- OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to change group name"))));
-}
GroupList.showGroup(GroupList.getElementGID(this));
});
- // Implements Groupname editing.
- $('#app-navigation').on('click', '.isgroup .rename', function (event) {
- event.stopPropagation();
- var $li = $(this).closest('li');
- var gid = GroupList.getElementGID(this);
- var groupname = escapeHTML(gid);
- var $input = $('<input type="text" value="' + groupname + '">');
- $li.find('.dorename img').hide();
- $li.find('.dorename span').replaceWith($input);
- $input.focus();
- $input.keypress(function (event) {
- if (event.keyCode === 13) {
- if ($input.val().length > 0) {
- $.post(
- OC.filePath('settings', 'ajax', 'changegroupname.php'),
- { groupname: $input.val() }
- );
- $input.blur();
- } else {
- $input.blur();
- }
- }
- });
- $input.blur(function () {
- var $input = $(this), groupname = $input.val();
- $input.closest('li').data('gid', groupname);
- $input.replaceWith('<span>' + escapeHTML(groupname) + '</span>');
- $li.find('img').show();
- });
- });
-
// Implements Quota Settings Toggle.
var $appSettings = $('#app-settings');
$('#app-settings-header').on('click keydown',function(event) {
<li data-gid="<?php p($group['name']) ?>" data-usercount="<?php p($group['usercount']) ?>" class="isgroup">
<a href="#" class="dorename">
<span class="groupname"><?php p($group['name']); ?></span>
- <!-- TODO: backend does not support renaming groups yet
- <img class="svg action rename"
- src="<?php p(image_path('core', 'actions/rename.svg'))?>"
- original-title="<?php p($l->t('Edit'))?>" alt="" />
- -->
</a>
<span class="utils">
<span class="usercount"><?php if($group['usercount'] > 0) { p($group['usercount']); } ?></span>
</span>
</li>
<?php endforeach; ?>
-</ul>
\ No newline at end of file
+</ul>