XWiki
XWikiGroupSheet
en
0
XWiki.XWikiGroups
XWiki.Admin
XWiki.Admin
xwiki:XWiki.Admin
1242173909000
1288812724000
1288812724000
1.1

#

Imported from XAR
false
xwiki/2.0
false
XWiki.SheetClass
0
defaultEditMode
1
Default Edit Mode
15
0
com.xpn.xwiki.objects.classes.StringClass
XWiki.XWikiGroupSheet
0
XWiki.SheetClass
6e184b54-5bb0-4d81-acaf-87493bc1b1e8
{{velocity output="false"}} #set($mainwk = $xcontext.isMainWiki()) #set($jsService = $services.javascript) #set($extJsParam = $jsService.createExtJSParam().setAction('file')) #set($extJsParam = $extJsParam.setLazyLoad(true)) $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/usersandgroups/usersandgroups.js'))## $services.css.includeCSSPage(':js/xwiki/usersandgroups/usersandgroups.css')## $!jsService.includeExtJsFile($extJsParam.setJsFile(':js/xwiki/table/livetable.js'))## $services.css.includeCSSPage(':js/xwiki/table/livetable.css')## #set($groupDoc = $doc) #if($doc.fullName == 'Main.UserDirectory') #set($groupDoc = $xwiki.getDocument('XWiki.XWikiAllGroup')) #end #macro(hasEditGroupRight) #set($hasEditGroupRight = false) #if($hasAdmin && $doc.getObject('XWiki.XWikiGroups', false)) #set($hasEditGroupRight = true) #end #end #hasEditGroupRight() ## ## {{/velocity}}

{{velocity}} #if($xcontext.action == 'inline' && $hasEditGroupRight) {{html}} <div id="addNewMember"> <table> <tr> <td class="addlabel">$msg.get('xe.admin.groups.addUser') #if(!$mainwk) </td> <td><select name="wiki" onchange="changeWiki(this);"> <option value="local" selected="selected">$msg.get('xe.admin.local')</option> <option value="global">$msg.get('xe.admin.global')</option> </select> </td> #else <input type="hidden" name="wiki" value="local" /></td> #end <td> <input id="userSuggest" type="text" size="30" name="newMember" autocomplete="off" /> </td> <td> <input type="button" id="addNewUser" class="button" value="$msg.get('xe.admin.groups.addUser.submit')" /> </td> </tr> <tr> <td class="addlabel">$msg.get('xe.admin.groups.addGroup') #if(!$mainwk) </td> <td><select name="wiki" onchange="changeWiki(this);"> <option value="local" selected="selected">$msg.get('xe.admin.local')</option> <option value="global">$msg.get('xe.admin.global')</option> </select> </td> #else <input type="hidden" name="wiki" value="local" /></td> #end <td> <input id="groupSuggest" type="text" size="30" name="newMember" autocomplete="off" /> </td> <td> <input type="button" id="addNewGroup" class="button" value="$msg.get('xe.admin.groups.addGroup.submit')" /> </td> </tr> <tr><td colspan="3" id="errMsg"></td></tr> </table> </div> ## ## <script type="text/javascript"> // <![CDATA[ if (typeof XWiki == "undefined") { var XWiki = {}; } Object.extend(XWiki, { groupmanager : { /* ** Initialize Group Manager javascript widgets (called on document load). */ userSuggest: null,

groupSuggest: null,

init: function() { if (XWiki.contextaction != 'view') { this.initSuggestWidget(); this.initAddNewMemberWidget(); } }, initSuggestWidget: function() { if ($('userSuggest')) { $('userSuggest').observe('focus', this.createSuggest.bind(this, $('userSuggest'), 'user', true)); } if ($('groupSuggest')) { $('groupSuggest').observe('focus', this.createSuggest.bind(this, $('groupSuggest'), 'group', false)); } }, initAddNewMemberWidget: function() { if ($('addNewUser')) { $('addNewUser').observe('click', this.addNewMember.bind(this, 'user', $('userSuggest'))); } if ($('addNewGroup')) { $('addNewGroup').observe('click', this.addNewMember.bind(this, 'group', $('groupSuggest'))); } }, addNewMember: function(uorg, input) { if (input) { var url = "${doc.getURL()}?xpage=adduorg&uorg=" + uorg + "&name=" + input.value; new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { $('userSuggest').value = ""; $('groupSuggest').value = ""; var nr = parseInt(transport.responseText); if (nr == 0) { if (uorg == "user") { $('errMsg').innerHTML = "$msg.get('xe.admin.groups.addUser.duplicate')"; } else { $('errMsg').innerHTML = "$msg.get('xe.admin.groups.addGroup.duplicate')"; } } else { var end = editgrouptable.limit; var start = editgrouptable.lastOffset; editgrouptable.clearCache(); if (start < 1) { start = 1; } editgrouptable.getRows(start, end, start, end); } } }); } } } }); XWiki.groupmanager.init(); // ]]> </script> {{/html}}#end #set($columnOptions = { "member" : {'link': 'auto', 'type': 'text'}, '_avatar' : { 'type' : 'none', 'link' : 'field', 'html' : 'true', 'sortable' : false }, "_actions" : { 'actions': ['delete'], 'actionCallbacks': {'delete': 'table.deleteRow(i);'}, 'ajaxActions': {'delete': true} } }) #if($hasAdmin && $xcontext.action == 'inline' && $hasEditGroupRight) #set($columns = ['_avatar', 'member', '_actions']) #else #set($columns = ['_avatar', 'member']) #end #livetable('groupusers', $columns, $columnOptions, {'url' : "${groupDoc.getURL('view', 'xpage=getgroupmembers')}", 'translationPrefix' : 'xe.admin.groups.', 'javascriptName' : 'editgrouptable'}) {{/velocity}}