Code source wiki de SearchSuggestSourceSheet
Modifié par Thomas Mortagne le 2022/06/29 12:10
Afficher les derniers auteurs
author | version | line-number | content |
---|---|---|---|
1 | {{velocity}} | ||
2 | #set ($className = 'XWiki.SearchSuggestSourceClass') | ||
3 | #set ($class = $xwiki.getDocument($className).xWikiClass) | ||
4 | #if (!$object && "$!request.xobjectNumber" != '') | ||
5 | #set ($object = $doc.getObject($className, $numbertool.toNumber($request.xobjectNumber).intValue())) | ||
6 | #end | ||
7 | #if (!$object) | ||
8 | #set ($object = $doc.getObject($className, true)) | ||
9 | #end | ||
10 | #set ($discard = $doc.use($object)) | ||
11 | #set ($prefix = "${className}_${object.number}_") | ||
12 | ## We include the 'get' action because we use it when adding a new search suggest source through AJAX. | ||
13 | #set ($editing = $xcontext.action == 'admin' || $xcontext.action == 'edit' || $xcontext.action == 'inline' || $xcontext.action == 'get') | ||
14 | (% class="xform" %)((( | ||
15 | #foreach ($property in $class.properties) | ||
16 | #set ($displayFormType = $property.getProperty('displayFormType')) | ||
17 | #set ($isCheckbox = $editing && $property.classType == 'Boolean' && (!$displayFormType || $displayFormType.value == 'checkbox')) | ||
18 | ; {{html wiki="true"}} | ||
19 | <label#if ($editing) for="${prefix}$property.name"#end> | ||
20 | #if ($isCheckbox) | ||
21 | $doc.display($property.name, 'edit') | ||
22 | #end | ||
23 | $property.translatedPrettyName | ||
24 | </label> | ||
25 | {{/html}}## | ||
26 | #set ($hintKey = "${className}_${property.name}.hint") | ||
27 | #if ($services.localization.get($hintKey)) | ||
28 | (% class="xHint" %){{translation key="$hintKey"/}}## | ||
29 | #end | ||
30 | |||
31 | #if (!$isCheckbox) | ||
32 | : #if ($editing) | ||
33 | $doc.display($property.name, 'edit') | ||
34 | #else | ||
35 | {{{$!object.getProperty($property.name).value}}} | ||
36 | #end | ||
37 | #end | ||
38 | #end | ||
39 | ))) | ||
40 | {{/velocity}} |