Wiki source code of XWikiUserSheet
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{velocity}} | ||
2 | ## | ||
3 | ## Extensions and vars | ||
4 | ## | ||
5 | $xwiki.ssx.use("XWiki.XWikiUserSheet")## | ||
6 | $xwiki.jsx.use("XWiki.XWikiUserSheet")## | ||
7 | #set($obj = $doc.getObject("XWiki.XWikiUsers")) | ||
8 | ## | ||
9 | ## Categories | ||
10 | ## | ||
11 | #set($categories = $util.arrayList) | ||
12 | #set($discard = $categories.add(['profile', $msg.get('platform.core.profile.category.profile'), 'XWiki.XWikiUserProfileSheet', 'icons/silk/vcard.gif'])) | ||
13 | #set($isMyProfile = ($services.model.resolveDocument($xcontext.user) == $doc.documentReference)) | ||
14 | #if($isMyProfile || $hasAdmin) | ||
15 | #set($discard = $categories.add(['preferences', $msg.get('platform.core.profile.category.preferences'), 'XWiki.XWikiUserPreferencesSheet', 'icons/silk/wrench.gif'])) | ||
16 | #end | ||
17 | ## TODO: add APIs to be able to display users watchlists to admins | ||
18 | #if($isMyProfile && $hasWatch) | ||
19 | #set($discard = $categories.add(['watchlist', $msg.get('platform.core.profile.category.watchlist'), 'XWiki.XWikiUserWatchListSheet', 'icons/silk/star.gif'])) | ||
20 | #end | ||
21 | #if ($isMyProfile) | ||
22 | #set ($discard = $categories.add(['network', $msg.get('platform.core.profile.category.network'), 'XWiki.XWikiUserNetworkSheet', 'icons/silk/group.gif'])) | ||
23 | #end | ||
24 | #if ($isMyProfile) | ||
25 | #set ($discard = $categories.add(['dashboard', $msg.get('platform.core.profile.category.dashboard'), 'XWiki.XWikiUserDashboardSheet', 'icons/silk/application_view_tile.gif'])) | ||
26 | #end | ||
27 | ## | ||
28 | ## Current category | ||
29 | ## | ||
30 | #set($currentCategory = "$!request.category") | ||
31 | #if($currentCategory == "") | ||
32 | #set($currentCategory = $listtool.get($listtool.get($categories, 0), 0)) | ||
33 | #end | ||
34 | ## | ||
35 | ## Display | ||
36 | ## | ||
37 | {{html clean="false"}} | ||
38 | <div id="vertical-panes"> | ||
39 | ## | ||
40 | ## Tabs | ||
41 | ## | ||
42 | <div id="vertical-tabs"> | ||
43 | <div id="avatar"> | ||
44 | {{/html}} | ||
45 | |||
46 | {{attachmentSelector classname="XWiki.XWikiUsers" object="$obj.number" property="avatar" #if ($isMyProfile) savemode="direct" #end defaultValue="XWiki.XWikiUserSheet@noavatar.png" width="120" alternateText="$xwiki.getUserName($doc.fullName, false)" buttontext="$msg.get('platform.core.profile.changePhoto')" displayImage="true" filter="png,jpg,gif"/}} | ||
47 | |||
48 | {{html clean="false"}} | ||
49 | </div>## avatar | ||
50 | <div> | ||
51 | <ul> | ||
52 | #foreach($tab in $categories) | ||
53 | #set($tabKey = $listtool.get($tab, 0)) | ||
54 | #set($tabName = $listtool.get($tab, 1)) | ||
55 | #set($tabIcon = $listtool.get($tab, 3)) | ||
56 | <li id="${tabKey}Tab" class="vertical-tab#if($tabKey == $currentCategory) active#end"><a href="?category=${tabKey}"><img src="$xwiki.getSkinFile($tabIcon)" alt="$tabName" /><span>$tabName</span></a></li> | ||
57 | #end | ||
58 | </ul> | ||
59 | </div> | ||
60 | </div> | ||
61 | ## | ||
62 | ## Panes | ||
63 | ## | ||
64 | #foreach($tab in $categories) | ||
65 | #set($tabKey = $listtool.get($tab, 0)) | ||
66 | #set($tabInclude = $listtool.get($tab, 2)) | ||
67 | <div id="${tabKey}Pane" class="vertical-pane#if($tabKey != $currentCategory) hidden#end"> | ||
68 | {{/html}} | ||
69 | |||
70 | {{include document="${tabInclude}" /}} | ||
71 | |||
72 | {{html clean="false"}} | ||
73 | </div> | ||
74 | #end | ||
75 | <div class="clearfloats"> </div> | ||
76 | </div> | ||
77 | #if ($request.get('xpage')) | ||
78 | <script type="text/javascript"> | ||
79 | document.fire('lightbox:userprofile:loaded'); | ||
80 | </script> | ||
81 | #end | ||
82 | {{/html}} | ||
83 | {{/velocity}} |