Dashboard

De SupraWiki
Revisão de 15h55min de 1 de junho de 2023 por Administrator (discussão | contribs) (Importacão de dados via API)
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)

Predefinição:Velocity

  1. set($displayDashboard = true)
  2. if ($xcontext.user != 'XWiki.XWikiGuest')
 ## get the preferences of the current user
 #set($userDbPrefs = $xwiki.getDocument($xcontext.user).getObject('Dashboard.UserDashboardPreferencesClass'))
 #if ($userDbPrefs)
   ## if the object exists, use the object value
   #set($prefValue = $userDbPrefs.getProperty('displayOnMainPage').value)
 #else
   ## if the object does not exist, use the default value of the property in the class
   #set($userPrefClass = $xwiki.getClass('Dashboard.UserDashboardPreferencesClass'))
   #set($displayOnMainPageProp = $userPrefClass.get('displayOnMainPage'))
   #set($prefValue = $displayOnMainPageProp.getProperty('defaultValue').value)
 #end
 #if ($prefValue && $prefValue > 0)
   #set($dashboardObjects = $xwiki.getDocument($xcontext.user).getObjects('XWiki.GadgetClass'))
   #if ($dashboardObjects.size() > 0)
     Predefinição:Dashboard source = "$xcontext.user" /
     #set($displayDashboard = false)
   #else
     #set($editDashboardLabel = $services.localization.render('platform.dashboard.wiki.personal.empty.edit'))
     #set($editDashboardUrl = $xwiki.getURL($xcontext.user, 'inline', 'category=dashboard'))
     Predefinição:InfoPredefinição:Html$services.localization.render('platform.dashboard.wiki.personal.empty', ["<a href='${editDashboardUrl}'>$editDashboardLabel</a>"])Predefinição:/htmlPredefinição:/info
     #set($displayDashboard = true)
   #end
 #end
  1. end
  1. if($displayDashboard)
 Predefinição:Dashboard/
  1. end

Predefinição:/velocity