Wiki source code of News

Version 5.1 by Thomas Mortagne on 2007/12/06

Hide last authors
Vincent Massol 1.1 1 #includeMacros("Main.Macros")
Vincent Massol 3.1 2 #set($wikinames = ["wwwdev", "code", "enterprise", "manager", "watch", "platform"])
Vincent Massol 1.1 3 <div>
4 <div id="webhomeblogdisplay" style="float:left; width: 50%;">
5 <div style="padding-right:20px;">
6 <h2 class="heading-1-1-1">Blog <a href="$xwiki.getURL("Main.BlogRss", "view", "xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" alt="rss icon"/></a></h2>
7 #set($nbstart = $request.nbstart)
8 #set($category = "")
9 #set($nbitems = "5")
10 #includeMacros("Blog.Macros")
11 </div>
12 </div>
13 <div id="webhomeNewsdisplay" style="float:left; width: 50%;">
14 <div style="padding-left: 20px;">
15 <h2 class="heading-1-1-1">Recent changes <a href="$xwiki.getURL("Main.WebRss", "view", "xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" alt="rss icon"/></a></h2>
16 #if(!$xwiki.hasMinorEdit() || $request.getParameter("showminor"))
17 #set ($sql = "where 1=1 order by doc.date desc")
18 #else
19 #set ($sql = ", XWikiRCSNodeInfo as ni where doc.id=ni.id.docId and ni.id.version2=1 group by doc.web, doc.name order by max(ni.date) desc")
20 #end
21 #set($showdata = 1)
22 #if(!$nb)
23 #set($nb = 30)
24 #end
25 #set($formatDate = "yyyy MMMM dd, HH:mm")
Thomas Mortagne 4.1 26 #set($documentsTool = $xwiki.parseGroovyFromPage("DocumentsTool"))
Thomas Mortagne 5.1 27 $documentsTool.setObjects($xwiki, $context)
Thomas Mortagne 4.1 28 #set($list = $documentsTool.getDocumentsModifs($sql, $wikinames, $nb))
Vincent Massol 1.1 29 <ul>
30 #foreach ($bentrydoc in $list)
31 #set($troubi ="non")
32 #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
33 #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
34 #set($comment = $cclass.newObject())
35 #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
36 #set($comments = $bentrydoc.getComments())
37 #else
38 #set($comments = $bentrydoc.getComments(false))
39 #end
40 #set($createur = $xwiki.getUserName($bentrydoc.author))
41 <li>
42 #if($comments.size()>0)
43 #set($i = 0)
44 #set($cobj = $comments.get($i))
45 #set($comment = $bentrydoc.display("comment", "view", $cobj))
46 #set($date = $cobj.getXWikiObject().get("date").value)
47 #if($date)
48 #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
49 #end
50 #if($bentrydoc)
51 #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
52 #end
53 #if($date1.equals($date2) )
54 [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
55 #set($troubi ="oui")
56 #set($desc = $cobj.getXWikiObject().get("comment").value)
57 #else
58 [$bentrydoc.name in $bentrydoc.web>$bentrydoc.prefixedFullName]
59 #end
60 #else
61 #set($comment = "")
62 [$bentrydoc.name in $bentrydoc.web>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
63 #end
64 $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
65 #if($troubi =="oui")
66 #set($createur = $xwiki.getUserName($cobj.author))
67 #end
68 #if ($createur == "XWikiGuest")
69 Guest
70 #else
71 $createur
72 #end
73 </li>
74 #end
75 #end
76 </ul>
77 #if($xwiki.hasMinorEdit())
78 #if($request.getParameter("showminor"))
79 <a href="$xwiki.getURL($tdoc.getFullName(), "view", "")">Hide minor edits</a>
80 #else
81 <a href="$xwiki.getURL($tdoc.getFullName(), "view", "showminor")">Show minor edits</a>
82 #end
83 #end
84 </div>
85 </div>
86 <div style="clear:both; margin-bottom: 40px;"><!-- --></div>
87 </div>
88

Get Connected