... |
... |
@@ -1,13 +1,4 @@ |
1 |
1 |
{{velocity}} |
2 |
|
-## If the translation key exists, use its value, otherwise use to the provided fallback value. |
3 |
|
-#macro (translateOrElse $translationKey $fallback) |
4 |
|
- #if($services.localization.get($translationKey)) |
5 |
|
- $services.rendering.escape($services.localization.render($translationKey), 'xwiki/2.1')## |
6 |
|
- #else |
7 |
|
- $fallback## |
8 |
|
- #end |
9 |
|
-#end |
10 |
|
- |
11 |
11 |
## Find all wiki macros sp that we can find if a registered macro is a wiki macro |
12 |
12 |
#set ($wikiMacroDocuments = $services.query.xwql("from doc.object(XWiki.WikiMacroClass) as macros").execute()) |
13 |
13 |
#set ($wikiMacroMap = {}) |
... |
... |
@@ -16,25 +16,17 @@ |
16 |
16 |
#set ($macroObject = $macroDocument.getObject("XWiki.WikiMacroClass")) |
17 |
17 |
#set ($discard = $wikiMacroMap.put($macroObject.id, [$macroDocument.documentReference.toString(), $macroObject.visibility])) |
18 |
18 |
#end |
19 |
|
-|={{translation key='help.macroList.id'/}}|={{translation key='help.macroList.name'/}}|={{translation key='help.macroList.categories'/}}|={{translation key='help.macroList.description'/}}|={{translation key='help.macroList.visibility'/}} |
|
10 |
+|=$services.localization.render('help.macroList.id')|=$services.localization.render('help.macroList.name')|=$services.localization.render('help.macroList.category')|=$services.localization.render('help.macroList.description')|=$services.localization.render('help.macroList.visibility') |
20 |
20 |
#foreach ($descriptor in $services.rendering.getMacroDescriptors('xwiki/2.1')) |
|
12 |
+ #set ($macroId = $macroDescriptor.id) |
21 |
21 |
#set ($wikiMacroData = $wikiMacroMap.get($descriptor.id.id)) |
22 |
22 |
#if ("$!wikiMacroData" != '') |
23 |
|
- #set ($displayId = "[[$services.rendering.escape($services.rendering.escape($descriptor.id, 'xwiki/2.1'), 'xwiki/2.1')>>$wikiMacroData.get(0)]]") |
|
15 |
+ #set ($displayId = "[[$descriptor.id>>$wikiMacroData.get(0)]]") |
24 |
24 |
#set ($displayVisibility = $wikiMacroData.get(1)) |
25 |
25 |
#else |
26 |
|
- #set ($displayId = $services.rendering.escape($descriptor.id, 'xwiki/2.1')) |
27 |
|
- #set ($displayVisibility = $services.localization.render('XWiki.WikiMacroClass_visibility_Global')) |
|
18 |
+ #set ($displayId = $descriptor.id) |
|
19 |
+ #set ($displayVisibility = "Global") |
28 |
28 |
#end |
29 |
|
- |$displayId|## |
30 |
|
- #translateOrElse("rendering.macro.${descriptor.id.id}.name", $descriptor.name) |
31 |
|
- |## |
32 |
|
- #foreach($category in $services.rendering.getMacroCategories($descriptor.id)) |
33 |
|
- #if($foreach.index>0), #end## |
34 |
|
- #translateOrElse("rendering.macroCategory.$category", $category) |
35 |
|
- #end## |
36 |
|
- |## |
37 |
|
- #translateOrElse("rendering.macro.${descriptor.id.id}.description", $descriptor.description) |
38 |
|
- |$services.rendering.escape($displayVisibility, 'xwiki/2.1') |
|
21 |
+ |$displayId|$descriptor.name|$!descriptor.defaultCategory|$descriptor.description|$displayVisibility |
39 |
39 |
#end |
40 |
40 |
{{/velocity}} |