Изменения документа Каталог пользователей
на 2013/01/07 22:57
на 2014/10/22 14:26
Комментарий
-
Свойства страницы (2 изменено, 0 добавлено, 0 удалено)
-
Объекты (1 изменено, 1 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Название
-
... ... @@ -1,1 +1,1 @@ 1 -$ msg.get("xe.userdirectory.title")1 +$services.localization.render('xe.userdirectory.title') - Содержимое
-
... ... @@ -9,7 +9,7 @@ 9 9 #set ($fakeUser = false) 10 10 ## 11 11 ## Set the fixed columns that we want the user directory to always show. 12 -#set ($columns = ['_avatar', 'doc. fullName'])12 +#set ($columns = ['_avatar', 'doc.name']) 13 13 ## 14 14 ## The columns that the user directory will default to when no user preferences exist or when the user resets to default. 15 15 #set ($defaultColumns = ['first_name', 'last_name']) ... ... @@ -19,7 +19,7 @@ 19 19 ## Guests and superadmin don't have an user profile and, therefore, no preferences. Offer default. 20 20 #if ($isGuest || $isSuperAdmin) 21 21 #if ($isGuest) 22 - {{info}}$ msg.get('xe.userdirectory.canCustomizeInfoGuest', "path:$doc.getURL('login')"){{/info}}22 + {{info}}$services.localization.render('xe.userdirectory.canCustomizeInfoGuest', ["path:$doc.getURL('login')"]){{/info}} 23 23 #end 24 24 ## Use the default columns for guests or superadmin. 25 25 #set ($discard = $columns.addAll($defaultColumns)) ... ... @@ -79,13 +79,13 @@ 79 79 ## 80 80 ## Customize form. Note: Using 2 forms to be able to do everything without JavaScript. 81 81 ## 82 - == $msg.get('xe.userdirectory.customizeColumnsTitle')==82 + == {{translation key="xe.userdirectory.customizeColumnsTitle"/}} == 83 83 {{html clean='false' wiki='true'}} 84 84 <form class='xform half' action="$doc.getURL($xcontext.action, $request.queryString)" method='post'> 85 85 <dl> 86 - <dt class='label'>87 - <label> $msg.get('xe.userdirectory.customizeAvailableColumnsLabel')</label>88 - <span class='xHint'> $msg.get('xe.userdirectory.customizeAvailableColumnsHint')</span>86 + <dt> 87 + <label>{{translation key="xe.userdirectory.customizeAvailableColumnsLabel"/}}</label> 88 + <span class='xHint'>{{translation key="xe.userdirectory.customizeAvailableColumnsHint"/}}</span> 89 89 </dt> 90 90 <dd> 91 91 <select name='value'> ... ... @@ -99,7 +99,7 @@ 99 99 <input type='hidden' name='xredirect' value="$xredirect" /> 100 100 <input type='hidden' name='action' value='add' /> 101 101 <span class='buttonwrapper'> 102 - <input type= 'submit'class='button'name='submit'value='$msg.get('xe.userdirectory.customizeAddColumnButtonLabel')'/>102 + <input type="submit" class="button" name="submit" value="$services.localization.render('xe.userdirectory.customizeAddColumnButtonLabel')" /> 103 103 </span> 104 104 </dt> 105 105 </dl> ... ... @@ -107,8 +107,8 @@ 107 107 <form class='xform half' action="$doc.getURL($xcontext.action, $request.queryString)" method='post'> 108 108 <dl> 109 109 <dt> 110 - <label> $msg.get('xe.userdirectory.customizeSelectedColumnsLabel')</label>111 - <span class='xHint'> $msg.get('xe.userdirectory.customizeSelectedColumnsHint')</span>110 + <label>{{translation key="xe.userdirectory.customizeSelectedColumnsLabel"/}}</label> 111 + <span class='xHint'>{{translation key="xe.userdirectory.customizeSelectedColumnsHint"/}}</span> 112 112 </dt> 113 113 <dd>$userPreferences.display('columns', 'edit', $userPreference)</dd> 114 114 <dt> ... ... @@ -115,21 +115,21 @@ 115 115 <input type='hidden' name='xredirect' value="$xredirect" /> 116 116 <input type='hidden' name='action' value='save' /> 117 117 <span class='buttonwrapper'> 118 - <input class='button' type='submit' name='submit' value="$ msg.get('xe.userdirectory.customizeSaveButtonLabel')"/>118 + <input class='button' type='submit' name='submit' value="$services.localization.render('xe.userdirectory.customizeSaveButtonLabel')"/> 119 119 </span> 120 120 <span class="buttonwrapper"> 121 - <a href="$doc.getURL($xcontext.action, "$request.queryString&action=reset&xredirect=$escapetool.url($xredirect)")" class='button secondary'> $msg.get('xe.userdirectory.customizeResetButtonLabel')</a>121 + <a href="$doc.getURL($xcontext.action, "$request.queryString&action=reset&xredirect=$escapetool.url($xredirect)")" class='button secondary'>{{translation key="xe.userdirectory.customizeResetButtonLabel"/}}</a> 122 122 </span> 123 123 </dt> 124 124 </dl> 125 125 </form> 126 126 ## 127 - <h2>$msg.get('xe.userdirectory.customizePreviewTitle')</h2>127 + == {{translation key="xe.userdirectory.customizePreviewTitle"/}} == 128 128 {{/html}} 129 129 #elseif ($isCustomized) 130 - {{warning}}$ msg.get('xe.userdirectory.isCustomizedWarning', ["$doc.fullName", "customize=true&action=reset&xredirect=$escapetool.url($xredirect)", "$doc.fullName", 'customize=true']){{/warning}}130 + {{warning}}$services.localization.render('xe.userdirectory.isCustomizedWarning', ["$doc.fullName", "customize=true&action=reset&xredirect=$escapetool.url($xredirect)", "$doc.fullName", 'customize=true']){{/warning}} 131 131 #else 132 - {{info}}$ msg.get('xe.userdirectory.canCustomizeInfo', ["$doc.fullName", 'customize=true']){{/info}}132 + {{info}}$services.localization.render('xe.userdirectory.canCustomizeInfo', ["$doc.fullName", 'customize=true']){{/info}} 133 133 #end 134 134 #end 135 135 ## ... ... @@ -150,7 +150,7 @@ 150 150 #set ($html = true) 151 151 #set ($sortable = false) 152 152 #set ($link = 'view') 153 - #elseif ($column == 'doc. fullName')153 + #elseif ($column == 'doc.name') 154 154 #set ($link = 'view') 155 155 #elseif ($classPropertyType.endsWith('ListClass')) 156 156 #set($type = 'list') ... ... @@ -158,6 +158,8 @@ 158 158 #set($type = 'number') 159 159 #elseif ($classPropertyType.endsWith('PasswordClass')) 160 160 #set($sortable = false) 161 + #elseif ($classPropertyType.endsWith('TextAreaClass') || $classPropertyType.endsWith('EmailClass')) 162 + #set($html = true) 161 161 #end 162 162 #set ($columnValue = { 'type' : $type, 'link' : $link, 'html' : $html, 'sortable' : $sortable, 'displayName' : $displayName }) 163 163 #set ($discard = $columnsProperties.put($column, $columnValue)) ... ... @@ -169,12 +169,46 @@ 169 169 ## If no override is present, use the default data source. 170 170 #set ($userDirectoryLivetableResultsReference = $services.model.createDocumentReference($xcontext.database, 'XWiki', 'UserDirectoryLivetableResults')) 171 171 #end 174 +## Note that we specify the class name even though we use a custom results page (which hard-codes it) because the class 175 +## name is needed by the live table filters, to have a proper drop down list for Static List fields for instance 176 +## (see XWIKI-9660). 172 172 #set ($options = { 178 + 'className': $services.model.serialize($xwikiUsersClassReference, 'local'), 173 173 'resultPage' : "$services.model.serialize($userDirectoryLivetableResultsReference)", 174 174 'translationPrefix' : 'xe.userdirectory.', 175 175 'tagCloud' : true, 176 176 'rowCount': 10 177 177 }) 184 +## Add a filter for subwikis 185 +#if ($xcontext.database != $xcontext.mainWikiName && "$!services.wiki" != '' && "$!services.wiki.user" != '') 186 + #set($userScope = $services.wiki.user.getUserScope($services.wiki.currentWikiId)) 187 + #if ($userScope == 'GLOBAL_ONLY') 188 + #set($discard = $options.put('extraParams', 'userScope=global')) 189 + #else 190 + #set($discard = $options.put('extraParams', 'userScope=local')) 191 + #end 192 + #if ($userScope == 'LOCAL_AND_GLOBAL') 193 + #set($discard = $xwiki.jsx.use('Main.UserDirectory')) 194 + 195 + {{html}} 196 + <form class="xform third" action=""> 197 + <dl> 198 + <dt> 199 + <label for="userScopeFilter">$services.localization.render('userdirectory.userScopeFilter')</label> 200 + <span class="xHint">$services.localization.render('userdirectory.userScopeFilter.hint')</span> 201 + </dt> 202 + <dd> 203 + <select name="userScope" id="userScopeFilter"> 204 + <option value="local">$services.localization.render('userdirectory.userScopeFilter.local')</option> 205 + <option value="global">$services.localization.render('userdirectory.userScopeFilter.global')</option> 206 + </select> 207 + </dd> 208 + </dl> 209 + </form> 210 + {{/html}} 211 + 212 + #end 213 +#end 178 178 #livetable('userdirectory' $columns $columnsProperties $options) 179 179 ## 180 180 ## Clean up any existing fake user from the current in-memory document to avoid side-effects
- XWiki.UIExtensionClass[0]
-
- Extension Parameters
-
... ... @@ -1,3 +1,3 @@ 1 -label=$ msg.get('xe.panels.quicklinks.userdirectory')1 +label=$services.localization.render('xe.panels.quicklinks.userdirectory') 2 2 target=Main.UserDirectory 3 3 icon=icon:group - Extension Scope
-
... ... @@ -1,0 +1,1 @@ 1 +wiki
- XWiki.JavaScriptExtension[0]
-
- Политика кеширования
-
... ... @@ -1,0 +1,1 @@ 1 +long - Код
-
... ... @@ -1,0 +1,41 @@ 1 +(function(){ 2 + 3 + /** 4 + * Init 5 + */ 6 + function init() { 7 + var userScope = $('userScopeFilter'); 8 + if (userScope === null) { 9 + // Nothing to do 10 + return; 11 + } 12 + userScope.observe('change', onUserScopeChange); 13 + } 14 + 15 + function onUserScopeChange(event) { 16 + var value = $('userScopeFilter').value; 17 + var livetable = window["livetable_userdirectory"]; 18 + var url = livetable.getUrl; 19 + if (url.search("userScope=") >= 0) { 20 + // Replace the old value 21 + if (value == 'local') { 22 + url = url.replace("userScope=global", "userScope=local"); 23 + } else { 24 + url = url.replace("userScope=local", "userScope=global"); 25 + } 26 + } else { 27 + url = url + "&userScope=" + value; 28 + } 29 + livetable.getUrl = url; 30 + // Reload the livetable 31 + livetable.clearCache(); 32 + livetable.showRows(1, livetable.limit); 33 + } 34 + 35 + /** 36 + * Call Init 37 + */ 38 + (XWiki && XWiki.domIsLoaded && init()) || document.observe("xwiki:dom:loaded", init); 39 + 40 +})(); 41 + - Название
-
... ... @@ -1,0 +1,1 @@ 1 +Dynamic filter for user scope - Разбор содержимого
-
... ... @@ -1,0 +1,1 @@ 1 +Нет - Использовать это расширение
-
... ... @@ -1,0 +1,1 @@ 1 +onDemand