Changes for page User Directory

Last modified by Ecaterina Valica on 2016/11/17 15:21

From version 14.1
edited by Admin
on 2012/08/06 21:13
Change comment: Imported from XAR
To version 17.1
edited by Ecaterina Valica
on 2013/10/22 16:28
Change comment: Import

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -$msg.get("xe.userdirectory.title")
1 +$services.localization.render('xe.userdirectory.title')
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Admin
1 +XWiki.evalica
Content
... ... @@ -5,6 +5,9 @@
5 5  #set ($directoryPreferencesClassReference = $services.model.createDocumentReference($xcontext.database, 'XWiki', 'UserDirectoryPreferencesClass'))
6 6  #set ($directoryPreferencesClassName = $services.model.serialize($directoryPreferencesClassReference))
7 7  ##
8 +## Fake user used in some cases to properly display class properties
9 +#set ($fakeUser = false)
10 +##
8 8  ## Set the fixed columns that we want the user directory to always show.
9 9  #set ($columns = ['_avatar', 'doc.fullName'])
10 10  ##
... ... @@ -16,7 +16,7 @@
16 16  ## Guests and superadmin don't have an user profile and, therefore, no preferences. Offer default.
17 17  #if ($isGuest || $isSuperAdmin)
18 18   #if ($isGuest)
19 - {{info}}$msg.get('xe.userdirectory.canCustomizeInfoGuest', "path:$doc.getURL('login')"){{/info}}
22 + {{info}}$services.localization.render('xe.userdirectory.canCustomizeInfoGuest', ["path:$doc.getURL('login')"]){{/info}}
20 20   #end
21 21   ## Use the default columns for guests or superadmin.
22 22   #set ($discard = $columns.addAll($defaultColumns))
... ... @@ -76,13 +76,13 @@
76 76   ##
77 77   ## Customize form. Note: Using 2 forms to be able to do everything without JavaScript.
78 78   ##
79 - == $msg.get('xe.userdirectory.customizeColumnsTitle') ==
82 + == {{translation key="xe.userdirectory.customizeColumnsTitle"/}} ==
80 80   {{html clean='false' wiki='true'}}
81 81   <form class='xform half' action="$doc.getURL($xcontext.action, $request.queryString)" method='post'>
82 82   <dl>
83 83   <dt class='label'>
84 - <label>$msg.get('xe.userdirectory.customizeAvailableColumnsLabel')</label>
85 - <span class='xHint'>$msg.get('xe.userdirectory.customizeAvailableColumnsHint')</span>
87 + <label>{{translation key="xe.userdirectory.customizeAvailableColumnsLabel"/}}</label>
88 + <span class='xHint'>{{translation key="xe.userdirectory.customizeAvailableColumnsHint"/}}</span>
86 86   </dt>
87 87   <dd>
88 88   <select name='value'>
... ... @@ -96,7 +96,7 @@
96 96   <input type='hidden' name='xredirect' value="$xredirect" />
97 97   <input type='hidden' name='action' value='add' />
98 98   <span class='buttonwrapper'>
99 - <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')" />
100 100   </span>
101 101   </dt>
102 102   </dl>
... ... @@ -104,8 +104,8 @@
104 104   <form class='xform half' action="$doc.getURL($xcontext.action, $request.queryString)" method='post'>
105 105   <dl>
106 106   <dt>
107 - <label>$msg.get('xe.userdirectory.customizeSelectedColumnsLabel')</label>
108 - <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>
109 109   </dt>
110 110   <dd>$userPreferences.display('columns', 'edit', $userPreference)</dd>
111 111   <dt>
... ... @@ -112,21 +112,21 @@
112 112   <input type='hidden' name='xredirect' value="$xredirect" />
113 113   <input type='hidden' name='action' value='save' />
114 114   <span class='buttonwrapper'>
115 - <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')"/>
116 116   </span>
117 117   <span class="buttonwrapper">
118 - <a href="$doc.getURL($xcontext.action, "$request.queryString&amp;action=reset&amp;xredirect=$escapetool.url($xredirect)")" class='button secondary'>$msg.get('xe.userdirectory.customizeResetButtonLabel')</a>
121 + <a href="$doc.getURL($xcontext.action, "$request.queryString&amp;action=reset&amp;xredirect=$escapetool.url($xredirect)")" class='button secondary'>{{translation key="xe.userdirectory.customizeResetButtonLabel"/}}</a>
119 119   </span>
120 120   </dt>
121 121   </dl>
122 122   </form>
123 123   ##
124 - <h2>$msg.get('xe.userdirectory.customizePreviewTitle')</h2>
127 + == {{translation key="xe.userdirectory.customizePreviewTitle"/}} ==
125 125   {{/html}}
126 126   #elseif ($isCustomized)
127 - {{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}}
128 128   #else
129 - {{info}}$msg.get('xe.userdirectory.canCustomizeInfo', ["$doc.fullName", 'customize=true']){{/info}}
132 + {{info}}$services.localization.render('xe.userdirectory.canCustomizeInfo', ["$doc.fullName", 'customize=true']){{/info}}
130 130   #end
131 131  #end
132 132  ##
... ... @@ -173,4 +173,9 @@
173 173   'rowCount': 10
174 174  })
175 175  #livetable('userdirectory' $columns $columnsProperties $options)
179 +##
180 +## Clean up any existing fake user from the current in-memory document to avoid side-effects
181 +#if ($fakeUser)
182 + #set ($discard = $doc.removeObject($fakeUser))
183 +#end
176 176  {{/velocity}}
XWiki.UIExtensionClass[0]
Extension Point ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.panels.Applications
Extension ID
... ... @@ -1,0 +1,1 @@
1 +platform.panels.userDirectoryApplication
Extension Parameters
... ... @@ -1,0 +1,3 @@
1 +label=$services.localization.render('xe.panels.quicklinks.userdirectory')
2 +target=Main.UserDirectory
3 +icon=icon:group
Extension Scope
... ... @@ -1,0 +1,1 @@
1 +wiki