Wiki source code of XWikiUserSheet
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | #set($obj = $doc.getObject("XWiki.XWikiUsers")) | ||
2 | #if(!$obj) | ||
3 | 1 $msg.get("xe.admin.users.sheet") | ||
4 | $msg.get("xe.admin.users.applyonusers") | ||
5 | #else | ||
6 | #set ($username = $xwiki.getUserName($doc.fullName, false)) | ||
7 | 1 $msg.get("platform.core.profile.title", [$username]) | ||
8 | #if($context.action=="view") | ||
9 | <div class="vcard"> | ||
10 | <span class="fn" style="display:none">$username</span> | ||
11 | #end | ||
12 | ##------------------------------------------------------------------ | ||
13 | ## Display a menu with common user actions: | ||
14 | ## - change password | ||
15 | ## - edit the profile | ||
16 | ## - change the avatar | ||
17 | ## - switch between simple/advanced modes | ||
18 | ## Note: This menu is only displayed if the current profile page is | ||
19 | ## that of the currently logged user | ||
20 | ##------------------------------------------------------------------ | ||
21 | #set($i = $context.user.indexOf(":")+1) | ||
22 | #set($isMyProfile = ($doc.fullName == $context.user.substring($i)) && ($context.action == "view")) | ||
23 | #if($isMyProfile || $xwiki.hasAdminRights()) | ||
24 | #if($isMyProfile) | ||
25 | #set($msgKeyEditSuffix = ".mine") | ||
26 | #end | ||
27 | <br /> | ||
28 | <div class="specialmenu"> | ||
29 | ## Check user is not from LDAP. In that case we can't modify the password has it is stored on LDAP server. | ||
30 | #if (!$doc.getObject("XWiki.LDAPProfileClass")) | ||
31 | * <img alt="" src="$xwiki.getSkinFile("icons/keys.png")"/> <a href="$doc.getURL("view", "xpage=passwd")">$msg.get("platform.core.profile.changePassword$!{msgKeyEditSuffix}")</a> | ||
32 | #end | ||
33 | * <img alt="" src="$xwiki.getSkinFile("icons/contact.png")"/> <a href="$doc.getURL("inline")">$msg.get("platform.core.profile.modifyProfile$!{msgKeyEditSuffix}")</a> | ||
34 | * <img alt="" src="$xwiki.getSkinFile("icons/changeavatar.png")"/> <a href="$doc.getURL("edit", "xpage=changemyavatar")">$msg.get("platform.core.profile.changePhoto$!{msgKeyEditSuffix}")</a> | ||
35 | ## Code to check whether the document's user with usertype advanced. | ||
36 | #set($contextUserType = "$!{doc.getObject('XWiki.XWikiUsers').getProperty('usertype').value}") | ||
37 | #if($contextUserType == 'Advanced') | ||
38 | #set($isContextUserAdvanced = true) | ||
39 | #else | ||
40 | #set($isContextUserAdvanced = false) | ||
41 | #end | ||
42 | #if($isContextUserAdvanced) | ||
43 | * <img alt="" src="$xwiki.getSkinFile("icons/simpleuser.png")"/> <a href="$doc.getURL("save", "XWiki.XWikiUsers_${obj.number}_usertype=Simple")">$msg.get("platform.core.profile.switchSimple")</a> | ||
44 | #else | ||
45 | * <img alt="" src="$xwiki.getSkinFile("icons/advanceduser.png")"/> <a href="$doc.getURL("save", "XWiki.XWikiUsers_${obj.number}_usertype=Advanced")">$msg.get("platform.core.profile.switchAdvanced")</a> | ||
46 | #end | ||
47 | </div> | ||
48 | <br /> | ||
49 | #end | ||
50 | #if($obj.getProperty("blogfeed") && $obj.getProperty("blogfeed").getValue() != "") | ||
51 | <div class="xwikiuserblog"> | ||
52 | {rss:feed=$doc.display("blogfeed", "view", $obj)|count=5} | ||
53 | </div> | ||
54 | #end | ||
55 | #if($obj.getProperty("avatar") && $obj.getProperty("avatar").getValue() != "") | ||
56 | #foreach ($attach in $doc.attachmentList) | ||
57 | #if($attach.filename == $obj.getProperty("avatar").getValue()) | ||
58 | <a href="$doc.getAttachmentURL($attach.filename, "download")" > | ||
59 | <img class="photo" id="xwikiuseravatar" alt="$doc.display("first_name", "view", $obj)" src="$doc.getAttachmentURL($attach.filename, "download")"/> | ||
60 | </a> | ||
61 | #end | ||
62 | #end | ||
63 | #end | ||
64 | ## Please do not insert extra empty lines here (as it affects the validity of the rendered xhtml) | ||
65 | <dl id="xwikiuserprofile"> | ||
66 | <dt class="label"><label>$msg.get("platform.core.profile.firstname"):</label></dt> | ||
67 | <dd#if($context.action=="view") class="given-name"#end>$doc.display("first_name", $obj)</dd> | ||
68 | <dt class="label"><label>$msg.get("platform.core.profile.lastname"):</label></dt> | ||
69 | <dd#if($context.action=="view") class="family-name"#end>$doc.display("last_name", $obj)</dd> | ||
70 | #if(($obj.getProperty("blog") && $obj.getProperty("blog").getValue() != "") || $context.action == "inline") | ||
71 | <dt class="label"><label>$msg.get("platform.core.profile.blog"):</label></dt> | ||
72 | <dd>$doc.display("blog", $obj)</dd> | ||
73 | #end | ||
74 | #if(($obj.getProperty("blogfeed") && $obj.getProperty("blogfeed").getValue() != "") || $context.action == "inline") | ||
75 | <dt class="label"><label>$msg.get("platform.core.profile.blogFeed"):</label></dt> | ||
76 | <dd>$doc.display("blogfeed", $obj)</dd> | ||
77 | #end | ||
78 | ## For security reasons do not display emails by default | ||
79 | ## #if(($obj.getProperty("email") && $obj.getProperty("email").getValue() != "") || $context.action == "inline") | ||
80 | ## <dt class="label"><label>$msg.get("platform.core.profile.email"):</label></dt> | ||
81 | ## <dd#if($context.action=="view") class="email"#end>#if($action == "inline")$doc.display("email", $obj)#else #set($discard = $doc.display("email", $obj))#obfuscate($discard)#end</dd> | ||
82 | ## #end | ||
83 | #if(($obj.getProperty("company") && $obj.getProperty("company").getValue() != "") || $context.action == "inline") | ||
84 | <dt class="label"><label>$msg.get("platform.core.profile.company"):</label></dt> | ||
85 | <dd#if($context.action=="view") class="org"#end>$doc.display("company", $obj)</dd> | ||
86 | #end | ||
87 | #if(($obj.getProperty("city") && $obj.getProperty("city").getValue() != "") || $context.action == "inline") | ||
88 | <dt class="label"><label>$msg.get("platform.core.profile.city"):</label></dt> | ||
89 | <dd#if($context.action=="view") class="locality"#end>$doc.display("city", $obj)</dd> | ||
90 | #end | ||
91 | #if(($obj.getProperty("country") && $obj.getProperty("country").getValue() != "") || $context.action == "inline") | ||
92 | <dt class="label"><label>$msg.get("platform.core.profile.country"):</label></dt> | ||
93 | <dd#if($context.action=="view") class="country-name"#end>$doc.display("country", $obj)</dd> | ||
94 | #end | ||
95 | </dl> | ||
96 | #if(($obj.getProperty("comment") && $obj.getProperty("comment").getValue().trim() != "") || $context.action == "inline") | ||
97 | 1.1 $msg.get("platform.core.profile.about") | ||
98 | $doc.display("comment", $obj) | ||
99 | #end | ||
100 | #if($context.action=="view") | ||
101 | </div> | ||
102 | #end | ||
103 | #end |