root / hci / trunk / .metadata / .plugins / org.eclipse.core.resources / .history / d8 / 7033f6ea1d12001014a7aaca645a4b74 @ 3
History | View | Annotate | Download (1.51 KB)
1 |
package com.eneraptor.hci |
---|---|
2 |
|
3 |
class ErptrTagLib { |
4 |
|
5 |
static namespace = 'erptr' |
6 |
def mainMenuService |
7 |
|
8 |
def menu = { attrs -> |
9 |
|
10 |
List menuItems = mainMenuService.getMainMenu() |
11 |
|
12 |
menuItems.each { |
13 |
out << "<li" |
14 |
if(attrs.chosen == it.name) { |
15 |
out << " class='current'" |
16 |
} |
17 |
out << "><a href='" |
18 |
out << g.createLink(controller: "${it.name}", action: "${it.url}") |
19 |
out << "'>${it.label}</a></li>" |
20 |
} |
21 |
|
22 |
} |
23 |
|
24 |
def subMenu = { attrs -> |
25 |
|
26 |
List subMenuItems = mainMenuService.getSubMenu(attrs.menu) |
27 |
if(subMenuItems == null) { |
28 |
out << "<p>This sub-menu is not configured yet.</p>" |
29 |
} else { |
30 |
subMenuItems.each { |
31 |
out << "<li><a href='" |
32 |
out << g.createLink(controller: "${it.name}", action: "${it.url}") |
33 |
out << "' class='" |
34 |
out << "${it.name}-${it.url}" |
35 |
out << "'>${it.label}</a></li>" |
36 |
} |
37 |
} |
38 |
|
39 |
} |
40 |
|
41 |
def box = { attrs, body -> |
42 |
|
43 |
out << "<div class='box'>" |
44 |
out << "<h3>${attrs['title']}</h3>" |
45 |
out << "<div class='boxContents'>" |
46 |
out << body() |
47 |
out << "</div>" |
48 |
out << "</div>" |
49 |
out << "<br />" |
50 |
|
51 |
} |
52 |
|
53 |
def helpBox = { |
54 |
out << "<div id='helpBox'>" |
55 |
out << "</div><br />" |
56 |
} |
57 |
|
58 |
def confirmBox = { attrs, body -> |
59 |
out << "<div id='confirmBox'>" |
60 |
out << "<div class='confirmBoxContent'>" |
61 |
out << body() |
62 |
out << "</div>" |
63 |
out << "</div><br />" |
64 |
} |
65 |
|
66 |
def errorBox = { attrs, body -> |
67 |
out << "<div id='errorBox'>" |
68 |
out << "<div class='errorBoxContent'>" |
69 |
out << body() |
70 |
out << "</div>" |
71 |
out << "</div><br />" |
72 |
} |
73 |
|
74 |
} |