Code source wiki de XWikiUserSheet

Modifié par Administrator le 2008/12/02 13:35

Afficher les derniers auteurs
1 #set($obj = $doc.getObject("XWiki.XWikiUsers"))
2 #if(!$obj)
3 1 User Sheet
4 This stylesheet must be applied on a document containing a XWiki.XWikiUsers object.
5 #else
6
7 #if($context.action=="view")
8 <div class="vcard">
9 #end
10
11 1 $msg.get("platform.core.profile.title", [$xwiki.getUserName($doc.fullName, false)])
12
13 ##------------------------------------------------------------------
14 ## Display a menu with common user actions:
15 ## - change password
16 ## - edit the profile
17 ## - change the avatar
18 ## - switch between simple/advanced modes
19 ## Note: This menu is only displayed if the current profile page is
20 ## that of the currently logged user
21 ##------------------------------------------------------------------
22 #set($i = $context.user.indexOf(":")+1)
23 #set($isMyProfile = ($doc.fullName == $context.user.substring($i)) && ($context.action == "view"))
24 #if($isMyProfile || $xwiki.hasAdminRights())
25 #if($isMyProfile)
26 #set($msgKeyEditSuffix = ".mine")
27 #end
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 #if($isAdvancedUser)
36 * <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>
37 #else
38 * <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>
39 #end
40 </div>
41 #end
42
43 #if($obj.getProperty("blogfeed") && $obj.getProperty("blogfeed").getValue() != "")
44 <div class="xwikiuserblog">
45 {rss:feed=$doc.display("blogfeed", "view", $obj)|count=5}
46 </div>
47 #end
48
49 #if($obj.getProperty("avatar") && $obj.getProperty("avatar").getValue() != "")
50 #foreach ($attach in $doc.attachmentList)
51 #if($attach.filename == $obj.getProperty("avatar").getValue())
52 <a href="$doc.getAttachmentURL($attach.filename, "download")" >
53 <img class="photo" id="xwikiuseravatar" alt="$doc.display("first_name", "view", $obj)" src="$doc.getAttachmentURL($attach.filename, "download")"/>
54 </a>
55 #end
56 #end
57 #end
58 ## Please do not insert extra empty lines here (as it the validity of the rendered xhtml)
59 <dl id="xwikiuserprofile">
60 <dt class="label"><label>$msg.get("platform.core.profile.firstname"):</label></dt>
61 <dd#if($context.action=="view") class="given-name"#end>$doc.display("first_name", $obj)</dd>
62 <dt class="label"><label>$msg.get("platform.core.profile.lastname"):</label></dt>
63 <dd#if($context.action=="view") class="family-name"#end>$doc.display("last_name", $obj)</dd>
64 #if(($obj.getProperty("blog") && $obj.getProperty("blog").getValue() != "") || $context.action == "inline")
65 <dt class="label"><label>$msg.get("platform.core.profile.blog"):</label></dt>
66 <dd>$doc.display("blog", $obj)</dd>
67 #end
68 #if(($obj.getProperty("blogfeed") && $obj.getProperty("blogfeed").getValue() != "") || $context.action == "inline")
69 <dt class="label"><label>$msg.get("platform.core.profile.blogFeed"):</label></dt>
70 <dd>$doc.display("blogfeed", $obj)</dd>
71 #end
72 ## For security reasons do not display emails by default
73 ## #if(($obj.getProperty("email") && $obj.getProperty("email").getValue() != "") || $context.action == "inline")
74 ## <dt class="label"><label>$msg.get("platform.core.profile.email"):</label></dt>
75 ## <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>
76 ## #end
77 #if(($obj.getProperty("company") && $obj.getProperty("company").getValue() != "") || $context.action == "inline")
78 <dt class="label"><label>$msg.get("platform.core.profile.company"):</label></dt>
79 <dd#if($context.action=="view") class="org"#end>$doc.display("company", $obj)</dd>
80 #end
81 #if(($obj.getProperty("city") && $obj.getProperty("city").getValue() != "") || $context.action == "inline")
82 <dt class="label"><label>$msg.get("platform.core.profile.city"):</label></dt>
83 <dd#if($context.action=="view") class="locality"#end>$doc.display("city", $obj)</dd>
84 #end
85 #if(($obj.getProperty("country") && $obj.getProperty("country").getValue() != "") || $context.action == "inline")
86 <dt class="label"><label>$msg.get("platform.core.profile.country"):</label></dt>
87 <dd#if($context.action=="view") class="country-name"#end>$doc.display("country", $obj)</dd>
88 #end
89 </dl>
90
91 #if(($obj.getProperty("comment") && $obj.getProperty("comment").getValue().trim() != "") || $context.action == "inline")
92 1.1 $msg.get("platform.core.profile.about")
93 $doc.display("comment", $obj)
94 #end
95
96 #if($context.action=="view")
97 </div>
98 #end
99
100 #end
#getBlogDocument($space $blogDoc)