Wiki source code of recentModificationsUpdater

Last modified by Holger Dick on 2010/08/20 15:47

Show last authors
1 #if($xwiki.hasAdminRights())
2 #set($recentlyCreated = $xwiki.searchDocuments("where space not like 'XWiki' and space not like 'Scheduler' and space not like 'Stats' and space not like 'Panels' order by doc.date desc", 5, 0))
3 #set($recentMods = $xwiki.getDocument("XWiki.recentModifications"))
4 #set($somestring = "<table class='stats' cellspacing='0' cellpadding='0'>")
5 #if($recentlyCreated.size() > 0)
6 #foreach($docname in $recentlyCreated)
7 #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
8 #set($userdoc = $xwiki.getDocument("${rdoc.getAuthor()}")) $userdoc.use("XWiki.XWikiUsers")
9 #set($name = $rdoc.displayTitle)
10 #if($name.length() >= 20)
11 #set($names= "${name.substring(0, 18)}")
12 #set($names= $names.concat('...'))
13 #else
14 #set($names= $name)
15 #end
16 #set($somestring = "$somestring" + "<tr><td style='border-width: 0px 0px 1px 0px; border-style: dashed; border-color: white;'><a href='$rdoc.getURL('view')'>$names</a></td><td style='border-width: 0px 0px 1px 0px; border-style: dashed; border-color: white;'>#if($userdoc.attachmentList.size()>0) #set($attach = $userdoc.attachmentList.get(0)) <img src='$userdoc.getAttachmentURL($attach.filename,'download', 'height=25')' height='25'/>#end</td></tr>")
17 #end
18 #set($somestring = "$somestring" + "</table>")
19 #else
20 #set($somestring = 'No Recent Updates :(')
21 #end
22 $recentMods.setContent("$somestring")
23 $recentMods.save()
24 #end