Wiki source code of Dashboard
Last modified by Simon Urli on 2025/02/12
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{velocity}} |
2 | #set($displayDashboard = true) | ||
![]() |
8.1 | 3 | #if ($xcontext.user != 'XWiki.XWikiGuest') |
![]() |
1.1 | 4 | ## get the preferences of the current user |
![]() |
8.1 | 5 | #set($userDbPrefs = $xwiki.getDocument($xcontext.user).getObject('Dashboard.UserDashboardPreferencesClass')) |
![]() |
1.1 | 6 | #if ($userDbPrefs) |
7 | ## if the object exists, use the object value | ||
8 | #set($prefValue = $userDbPrefs.getProperty('displayOnMainPage').value) | ||
9 | #else | ||
10 | ## if the object does not exist, use the default value of the property in the class | ||
![]() |
5.1 | 11 | #set($userPrefClass = $xwiki.getClass('Dashboard.UserDashboardPreferencesClass')) |
![]() |
1.1 | 12 | #set($displayOnMainPageProp = $userPrefClass.get('displayOnMainPage')) |
13 | #set($prefValue = $displayOnMainPageProp.getProperty('defaultValue').value) | ||
14 | #end | ||
15 | #if ($prefValue && $prefValue > 0) | ||
![]() |
8.1 | 16 | #set($dashboardObjects = $xwiki.getDocument($xcontext.user).getObjects('XWiki.GadgetClass')) |
![]() |
1.1 | 17 | #if ($dashboardObjects.size() > 0) |
![]() |
8.1 | 18 | {{dashboard source = "$xcontext.user" /}} |
![]() |
1.1 | 19 | #set($displayDashboard = false) |
20 | #else | ||
![]() |
7.1 | 21 | #set($editDashboardLabel = $services.localization.render('platform.dashboard.wiki.personal.empty.edit')) |
![]() |
8.1 | 22 | #set($editDashboardUrl = $xwiki.getURL($xcontext.user, 'inline', 'category=dashboard')) |
![]() |
7.1 | 23 | {{info}}{{html}}$services.localization.render('platform.dashboard.wiki.personal.empty', ["<a href='${editDashboardUrl}'>$editDashboardLabel</a>"]){{/html}}{{/info}} |
![]() |
1.1 | 24 | #set($displayDashboard = true) |
25 | #end | ||
26 | #end | ||
27 | #end | ||
28 | |||
29 | #if($displayDashboard) | ||
30 | {{dashboard/}} | ||
31 | #end | ||
![]() |
23.1 | 32 | |
![]() |
1.1 | 33 | {{/velocity}} |
![]() |
16.1 | 34 |