一般动作
登录
Wiki: BROPEN ▼: Document Index
»
Space: Dashboard ▼: Document Index
»
Page: XWikiUserDashboardSheet
搜索
default
页面动作
导出 ▼: 以PDF格式导出 以RTF格式导出 以HTML格式导出
更多动作 ▼: 打印预览 察看源码
XWikiUsers » XWikiUserSheet的资料 » XWikiUserDashboardSheet

# Wiki源代码XWikiUserDashboardSheet

在2013-10-01 11:53上被Administrator修改
评论 (0) · 附件 (0) · 记录 · 信息
隐藏行号 1: {{velocity}} 2: #set($userObj = $doc.getObject("XWiki.XWikiUsers")) 3: #if(!$userObj) 4: {{info}}$services.localization.render('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 xform"> 24: <div class="userDashboard"> 25: #if($xcontext.action == 'view' && $hasEdit) 26: <div class="editProfileCategory"><a href="$doc.getURL('inline', 'category=dashboard')"><span class="hidden">$services.localization.render('platform.core.profile.category.dashboard.edit')</span></a></div> 27: #end 28: <h1>$services.localization.render('platform.dashboard.user.preferences')</h1> 29: <dl> 30: <dt class="label"><label>$services.localization.render('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}}

# 快速链接

- 首页
- 新闻动态
- FAQ

Copyright © 2013 北京博瑞开源软件有限公司
京ICP备12048974号