General Actions:
Log-in
Register
Wiki:
Main wiki
▼
:
Document Index
»
Space:
Dashboard
▼
:
Document Index
»
Page:
XWikiUserDashboardSheet
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
XWikiUsers
»
XWikiUserSheet
»
XWikiUserDashboardSheet
Wiki source code of
XWikiUserDashboardSheet
Last modified by
Administrator
on 2012/03/21 17:40
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
{{velocity}} #set($userObj = $doc.getObject("XWiki.XWikiUsers")) #if(!$userObj) {{info}}$msg.get('xe.admin.users.applyonusers'){{/info}} #else #set($dashboardPrefs = $doc.getObject("Dashboard.UserDashboardPreferencesClass")) #if(!$dashboardPrefs) ## create the object and then display #set($dashboardPrefs = $doc.newObject("Dashboard.UserDashboardPreferencesClass")) ## get the default value of the property that we're interested in #set($dbPrefsClass = $dashboardPrefs.xWikiClass) #set($displayOnMainPageProp = $dbPrefsClass.get('displayOnMainPage')) #set($defaultValue = $displayOnMainPageProp.getProperty('defaultValue').value) ## this default value is of type long, for some reason, so I'll have to compare here instead of just set #if ($defaultValue > 0) #set($ok = $dashboardPrefs.set('displayOnMainPage', 1)) #else #set($ok = $dashboardPrefs.set('displayOnMainPage', 0)) #end #set($ok = $doc.save()) #end {{html clean="false" wiki="true"}} <div class="full column"> <div class="userDashboard"> #if($xcontext.action == 'view' && $hasEdit) <div class="editProfileCategory"><a href="$doc.getURL('inline', 'category=dashboard')"><span class="hidden">$msg.get('platform.core.profile.category.dashboard.edit')</span></a></div> #end <h1>$msg.get('platform.dashboard.user.preferences')</h1> <dl> <dt class="label"><label>$msg.get('platform.dashboard.user.displayOnMainPage')</label></dt> <dd>$doc.display('displayOnMainPage', $dashboardPrefs)</dd> </dl> </div> </div> {{/html}} #if ("$!{request.xpage}" != 'edituser') {{dashboard/}} #end #end {{/velocity}}