Wiki source code of Macros

Version 10.1 by Silvia Rusu on 2010/03/15 11:40

Show last authors
1 ## 1 XWiki Enterprise Design Mockups
2
3 #macro(licenseViolationWarning)
4 #set($mockups=$xwiki.mockups)
5 #if($xwiki.hasAccessLevel('admin'))
6 #set($licenseURL=$xwiki.getURL("Mockups.MockupsLicenseInfo", "view"))
7 #set($licenseLink="If you bought a license, <a href=${licenseURL}>click here</a> to register.")
8 #else
9 #set($licenseLink="")
10 #end
11 #if($mockups.isTrial())
12 #if($mockups.isTrialExpired())
13 <div style="background-color:#fcc;text-align:center;clear:both;width:400px;margin:0px auto;">
14 <b>EVALUATION LICENSE EXPIRED</b> - <a href="http://www.balsamiq.com/products/mockups/xwiki">buy Balsamiq Mockups now</a> to continue editing your mockups. ${licenseLink}
15 </div>
16 #else
17 <div style="background-color:#fcc;text-align:center;clear:both;width:400px;margin:0px auto;">
18 <b>EVALUATION LICENSE</b> - Are you enjoying Balsamiq Mockups? Please consider <a href="http://www.balsamiq.com/products/mockups/xwiki">purchasing it</a> today. ${licenseLink}
19 </div>
20 #end
21 #else
22 #if(!$mockups.isUserCountValid())
23 <div style="background-color:#fcc;text-align:center;clear:both;width:400px;margin:0px auto;">
24 <b>End User License Agreement Violation</b>: your license for Balsamiq Mockups is for ${mockups.maxUserCount} users, but the [Mockups.BalsamiqMockupsEditors] group contains ${mockups.currentUserCount} members. You must either remove some users from the group or <a href="http://www.balsamiq.com/products/mockups/xwiki#upgrades">upgrade your license</a>. ${licenseLink}
25 </div>
26 #end
27 #end
28 #end
29
30 #macro(mockup $name)
31 #set($mockups=$xwiki.mockups)
32 #set($hasEdit=$xwiki.hasAccessLevel('edit'))
33 #set($png=false)
34 #set($xml=false)
35 #set($png=$doc.getAttachment("${name}.png"))
36 #set($xml=$doc.getAttachment("${name}.bmml"))
37 #if($png and $xml)
38 <h1>$name</h1>
39
40 <div align="center">
41 ##
42 ## THANKS NOT TO EDIT THIS MACRO
43 ##
44 <a href="$doc.getAttachmentURL("${name}.png")">{image:${name}.png|halign=center|alt=$name}</a>
45 #if($mockups.canLoadEditor() and $hasEdit)<a href="$xwiki.getURL($doc.fullName, "loadeditor", "mockup=$name")">edit this mockup</a>#end
46 </div>
47 #else
48 #if(!$png)
49 <div class="error"><span class="error">Mockup image file ${name}.png not found. Did someone delete it?</span></div>
50 #end
51 #if(!$xml)
52 <div class="error"><span class="error">Mockup bmml file ${name}.bmml not found. Did someone delete it?</span></div>
53 #end
54 #end
55 #licenseViolationWarning()
56 #end