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
Hide line numbers
1: {{velocity}} 2: #set($userObj = $doc.getObject("XWiki.XWikiUsers")) 3: #if(!$userObj) 4: {{info}}$msg.get('xe.admin.users.applyonusers'){{/info}} 5: #else 6: #set($dashboardPrefs = $doc.getObject("Dashboard.UserDashboardPreferencesClass")) 7: #if(!$dashboardPrefs) 8: ## create the object and then display 9: #set($dashboardPrefs = $doc.newObject("Dashboard.UserDashboardPreferencesClass")) 10: ## get the default value of the property that we're interested in 11: #set($dbPrefsClass = $dashboardPrefs.xWikiClass) 12: #set($displayOnMainPageProp = $dbPrefsClass.get('displayOnMainPage')) 13: #set($defaultValue = $displayOnMainPageProp.getProperty('defaultValue').value) 14: ## this default value is of type long, for some reason, so I'll have to compare here instead of just set 15: #if ($defaultValue > 0) 16: #set($ok = $dashboardPrefs.set('displayOnMainPage', 1)) 17: #else 18: #set($ok = $dashboardPrefs.set('displayOnMainPage', 0)) 19: #end 20: #set($ok = $doc.save()) 21: #end 22: {{html clean="false" wiki="true"}} 23: <div class="full column"> 24: <div class="userDashboard"> 25: #if($xcontext.action == 'view' && $hasEdit) 26: <div class="editProfileCategory"><a href="$doc.getURL('inline', 'category=dashboard')"><span class="hidden">$msg.get('platform.core.profile.category.dashboard.edit')</span></a></div> 27: #end 28: <h1>$msg.get('platform.dashboard.user.preferences')</h1> 29: <dl> 30: <dt class="label"><label>$msg.get('platform.dashboard.user.displayOnMainPage')</label></dt> 31: <dd>$doc.display('displayOnMainPage', $dashboardPrefs)</dd> 32: </dl> 33: </div> 34: </div> 35: {{/html}} 36: #if ("$!{request.xpage}" != 'edituser') 37: 38: {{dashboard/}} 39: #end 40: #end 41: {{/velocity}}