commons_backport.html
1 <#-- WARNING : LUTECE-BACKPORT should only be use in case of error at executing an old plugin. This is a minimal compatibility service. It has to be removed asap so fix your templates ;-) ! -->
2 <#macro comboWithParams name default_value additionalParameters items>
3 <!-- WARNING : macro comboWithParams is deprecated -->
4 <@select id='${name}' name='${name}' default_value=default_value items=items params=additionalParameters />
5 </#macro>
6 <#macro comboSortedWithParams name default_value additionalParameters items id=name>
7 <!-- WARNING : macro comboSortedWithParams is deprecated -->
8 <@select id='${id}' name='${name}' sort=true default_value=default_value items=items params=additionalParameters />
9 </#macro>
10 <#macro comboWithParamsAndLength name default_value additionalParameters items max_length >
11 <!-- WARNING : macro comboWithParamsAndLength is deprecated -->
12 <@select id='${name}' name='${name}' default_value=default_value items=items maxLength=max_length params=additionalParameters />
13 </#macro>
14 <#macro combo name default_value items>
15 <#-- WARNING : macro combo is deprecated -->
16 <@comboWithParams name="${name}" default_value="${default_value}" additionalParameters="" items=items />
17 </#macro>
18 <#macro comboSorted name default_value items >
19 <#-- WARNING : macro comboSorted is deprecated -->
20 <@combo name="${name}" default_value="${default_value}" items=items?sort_by("name") />
21 </#macro>
22 <#macro radioImageList name default_value items inline=0>
23 <#-- WARNING : macro radioImageList is deprecated -->
24 <#list items as item>
25 <#if inline><#local orientation='inline' /><#else><#local orientation='vertical' /></#if>
26 <#if default_value='${item.code}'><#local checked=true /><#else><#local checked=false /></#if>
27 <#local radioLabelKey>
28 <img src="${item.name}" alt="${item.name}" title="${item.name}" />
29 </#local>
30 <@radioButton orientation=orientation labelFor='${name}' labelKey=radioLabelKey checked=checked name='${name}' value='${item.code}' />
31 </#list>
32 </#macro>
33 <#macro checkboxList name default_values items inline=0>
34 <#-- WARNING : macro checkboxList is deprecated -->
35 <#list items as item>
36 <#if inline><#local orientation='inline' /><#else><#local orientation='vertical' /></#if>
37 <@checkBox orientation=orientation labelFor='${item?index}' labelKey='${item.name}' name='${name}' id='${item?index}' value='${item.code}' checked=item.checked />
38 </#list>
39 </#macro>
40 <#macro dataTable dataTableManager actionMacro='' tableClass='' caption='' summary='data table'>
41 <#-- WARNING : macro dataTable is deprecated -->
42 <#if 0 < dataTableManager.items?size >
43 <#if dataTableManager.enablePaginator>
44 <@tform type='inline' method='post' action='${dataTableManager.sortUrl}'>
45 <#if (dataTableManager.paginator.pagesCount > 1) >
46 <@paginationPageLinks paginator=dataTableManager.paginator />
47 </#if>
48 <@div>
49 <@paginationItemCount paginator=dataTableManager.paginator combo=1 nb_items_per_page=dataTableManager.paginator.itemsPerPage?string />
50 </@div>
51 <@input type='hidden' name='${dataTableManager.id}' id='${dataTableManager.id}' value='${dataTableManager.id}' />
52 </@tform>
53 </#if>
54 <@table class='${tableClass}' summary='${summary}' caption='${caption}'>
55 <@tr>
56 <#list dataTableManager.listColumn as column>
57 <@th scope='col'>
58 #i18n{${column.titleKey}}
59 <#if !(column.typeColumn = "ACTION") && column.sortable>
60 <@sort jsp_url=dataTableManager.sortUrl attribute=column.parameterName />
61 </#if>
62 </@th>
63 </#list>
64 </@tr>
65 <#list dataTableManager.items as item>
66 <@tr>
67 <#list dataTableManager.listColumn as column>
68 <#if column.typeColumn = "STRING">
69 <#assign propName = "item." + column.parameterName>
70 <#assign value = propName?eval>
71 <@td>${value!}</@td>
72 <#elseif column.typeColumn = "LABEL">
73 <#assign propName = "item." + column.parameterName>
74 <#assign value = propName?eval>
75 <@td>#i18n{${value!}}</@td>
76 <#elseif column.typeColumn = "BOOLEAN">
77 <#assign propName = "item." + column.parameterName>
78 <#assign value = propName?eval>
79 <#if value?? && value>
80 <@td><@tag color='success' title='#i18n{${column.labelTrue!}}'><@icon style='check' />#i18n{${column.labelTrue!}}</@tag></@td>
81 <#else>
82 <@td><@tag color='danger' title='#i18n{${column.labelFalse!}}'><@icon style='times' />#i18n{${column.labelFalse!}}</@tag></@td>
83 </#if>
84 <#elseif column.typeColumn = "EMAIL">
85 <#assign propName = "item." + column.parameterName>
86 <#assign value = propName?eval>
87 <@td><#if value?? && value != ""><@link href='mailto:${value}' title='${value}'>${value}</@link></#if></@td>
88 <#elseif column.typeColumn = "ACTION">
89 <#if column.parameterName?? && column.parameterName != "">
90 <#assign macroName = column.parameterName>
91 <#elseif actionMacro?? && actionMacro != "">
92 <#assign macroName = actionMacro>
93 </#if>
94 <#if macroName?? && macroName != "">
95 <@td><@.vars[macroName] item=item /></@td>
96 </#if>
97 </#if>
98 </#list>
99 </@tr>
100 </#list>
101 </@table>
102 <#if dataTableManager.enablePaginator>
103 <@tform type='inline' method='post' action='${dataTableManager.sortUrl}'>
104 <#if (dataTableManager.paginator.pagesCount > 1) >
105 <@paginationPageLinks paginator=dataTableManager.paginator />
106 </#if>
107 <@div align='right'>
108 <@paginationItemCount paginator=dataTableManager.paginator combo=0 nb_items_per_page=dataTableManager.paginator.itemsPerPage?string />
109 </@div>
110 <@input type='hidden' name='${dataTableManager.id}' id='${dataTableManager.id}' value='${dataTableManager.id}' />
111 </@tform>
112 </#if>
113 <#else>
114 #i18n{portal.util.labelNoItem}
115 </#if>
116 </#macro>
117 <#macro filterPanel dataTableManager formClass=''>
118 <#-- WARNING : macro filterPanel is deprecated -->
119 <#if dataTableManager.filterPanel.listFilter?? && 0 < dataTableManager.filterPanel.listFilter?size>
120 <@tform class='${formClass!}' method='post' action='${dataTableManager.filterPanel.formUrl}'>
121 <@fieldSet>
122 <#list dataTableManager.filterPanel.listFilter as filter>
123 <@formGroup labelFor='description' labelKey='#i18n{${filter.filterLabel}}'>
124 <#if filter.filterType = "STRING">
125 <@input type='text' name='${dataTableManager.filterPanelPrefix}${filter.parameterName}' id='${filter.parameterName}' inputSize=30 value='${filter.value!}' />
126 <#elseif filter.filterType = "BOOLEAN">
127 <@checkBox labelFor='' labelKey='' name='${dataTableManager.filterPanelPrefix}${filter.parameterName}' id='${dataTableManager.filterPanelPrefix}${filter.parameterName}' value='true' checked=(filter.value?? && filter.value = 'true') />
128 <#elseif filter.filterType = "DROPDOWNLIST">
129 <#if filter.value??>
130 <#local filter_value = filter.value >
131 <#else>
132 <#local filter_value = '' >
133 </#if>
134 <@select name=dataTableManager.filterPanelPrefix+filter.parameterName default_value=filter_value items=filter.refList />
135 </#if>
136 </@formGroup>
137 </#list>
138 <@formGroup>
139 <@input type='hidden' name='${dataTableManager.filterPanelPrefix}updateFilters' id='${dataTableManager.filterPanelPrefix}updateFilters' value='true' />
140 <@input type='hidden' name='${dataTableManager.id}' id='${dataTableManager.id}' value='${dataTableManager.id}' />
141 <@button type='submit' buttonIcon='search' title='#i18n{portal.util.labelSearch}' hideTitle=['xs'] />
142 <#if dataTableManager.filterPanel.formUrl?contains("?")>
143 <#local dataTableResetUrl = dataTableManager.filterPanel.formUrl + "&" + dataTableManager.filterPanelPrefix + "resetFilters=true" />
144 <#else>
145 <#local dataTableResetUrl = dataTableManager.filterPanel.formUrl + "?" + dataTableManager.filterPanelPrefix + "resetFilters=true" />
146 </#if>
147 <@aButton href='${dataTableResetUrl}' title='#i18n{portal.util.labelReset}' buttonIcon='times' hideTitle=['xs'] />
148 </@formGroup>
149 </@fieldSet>
150 </@tform>
151 </#if>
152 </#macro>
153 <#macro fieldInputText i18nLabelKey inputName mandatory=false value="" maxlength=0 i18nHelpBlockKey='' cssClass=''>
154 <#-- WARNING : macro fieldInputText is deprecated -->
155 <#if maxlength gt 0><#local params = 'maxlength=${maxlength}' /></#if>
156 <@formGroup labelFor='${inputName}' labelKey='#i18n{${i18nLabelKey}}' mandatory=mandatory helpKey='#i18n{${i18nHelpBlockKey}}'>
157 <@input type='text' name='${inputName}' id='${inputName}' class='${cssClass!}' value='${value}' params=params! />
158 </@formGroup>
159 </#macro>
160 <#macro fieldInputPassword i18nLabelKey inputName mandatory=false value="" maxlength=0 i18nHelpBlockKey='#i18n{${i18nHelpBlockKey}}' cssClass=''>
161 <#-- WARNING : macro fieldInputPassword is deprecated -->
162 <#if maxlength gt 0><#local params = 'maxlength=${maxlength}' /></#if>
163 <@formGroup labelFor='${inputName}' labelKey='#i18n{${i18nLabelKey}}' helpKey='' mandatory=mandatory>
164 <@input type='password' name='${inputName}' id='${inputName}' class='${cssClass!}' value='${value}' params=params! />
165 </@formGroup>
166 </#macro>
167 <#macro fieldInputWrapper i18nLabelKey inputName mandatory=false value="" maxlength=0 i18nHelpBlockKey='' cssClass='form-control'>
168 <#-- WARNING : macro fieldInputWrapper is deprecated -->
169 <@formGroup labelFor='${inputName}' labelKey='#i18n{${i18nLabelKey}}' helpKey='#i18n{${i18nHelpBlockKey}}' mandatory=mandatory>
170 <#nested>
171 </@formGroup>
172 </#macro>
173 <#macro fieldStaticText i18nLabelKey cssClass=''>
174 <#-- WARNING : macro fieldStaticText is deprecated -->
175 <@formGroup labelKey='#i18n{${i18nLabelKey}}'>
176 <@staticText>
177 <#nested>
178 </@staticText>
179 </@formGroup>
180 </#macro>
181 <#macro fieldInputCalendar i18nLabelKey inputName mandatory=false value="" i18nHelpBlockKey='' cssClass='form-control' language='fr'>
182 <#-- WARNING : macro fieldInputCalendar is deprecated -->
183 <@formGroup labelFor='${inputName}' labelKey='#i18n{${i18nLabelKey}}' helpKey='#i18n{${i18nHelpBlockKey}}' mandatory=mandatory>
184 <@inputGroup>
185 <@inputGroupItem type='text'>
186 <@icon style='calendar' />
187 </@inputGroupItem>
188 <@input type='text' name='${inputName}' id='${inputName}' class='${cssClass!}' value='${value}' />
189 </@inputGroup>
190 <@getDate idField=inputName language=language />
191 </@formGroup>
192 </#macro>
193 <#macro fieldInputCheckBox i18nLabelKey inputName value="" disabled=false checked=false i18nHelpBlockKey='' cssClass='' >
194 <#-- WARNING : macro fieldInputCheckBox is deprecated -->
195 <@formGroup helpKey='#i18n{${i18nHelpBlockKey}}'>
196 <@checkBox labelFor='${inputName}id' labelKey='#i18n{${i18nLabelKey}}' class='${cssClass}' id='${inputName}id' name='${inputName}' value='${value}' disabled=disabled checked=checked />
197 </@formGroup>
198 </#macro>
199 <#macro fieldInputRadioBox i18nLabelKey inputName value="" disabled=false checked=false i18nHelpBlockKey='' cssClass='' >
200 <#-- WARNING : macro fieldInputRadioBox is deprecated -->
201 <@formGroup helpKey='#i18n{${i18nHelpBlockKey}}'>
202 <@radioButton labelFor='${inputName}id' labelKey='#i18n{${i18nLabelKey}}' id='${inputName}id' name='${inputName}' value='${value}' checked=checked disabled=disabled />
203 </@formGroup>
204 </#macro>
205 <#macro fieldInputCheckBoxInline inputName value="" disabled=false checked=false >
206 <#-- WARNING : macro fieldInputCheckBoxInline is deprecated -->
207 <@checkBox orientation='inline' labelFor='${inputName}id' id='${inputName}id' name='${inputName}' value='${value}' disabled=disabled checked=checked />
208 </#macro>
209 <#macro fieldInputRadioBoxInline inputName value="" disabled=false checked=false >
210 <#-- WARNING : macro fieldInputRadioBoxInline is deprecated -->
211 <@radioButton orientation='inline' labelFor='${inputName}id' id='${inputName}id' name='${inputName}' value='${value}' disabled=disabled checked=checked />
212 </#macro>
213 <#macro fieldInputCombo i18nLabelKey inputName items value="" mandatory=false i18nHelpBlockKey='' cssClass='form-control'>
214 <#-- WARNING : macro fieldInputCombo is deprecated -->
215 <@formGroup labelFor='${inputName}' labelKey='#i18n{${i18nLabelKey}}' helpKey='#i18n{${i18nHelpBlockKey}}' mandatory=mandatory>
216 <#assign params = "class='" + cssClass + "'" >
217 <@select name=inputName items=items default_value=value params=params />
218 </@formGroup>
219 </#macro>
220 <#macro fieldTextArea i18nLabelKey inputName mandatory=false value="" maxlength=0 i18nHelpBlockKey='' cssClass=''>
221 <#-- WARNING : macro fieldTextArea is deprecated -->
222 <@formGroup labelFor='${inputName}' labelKey='#i18n{${i18nLabelKey}}' helpKey='#i18n{${i18nHelpBlockKey}}' mandatory=mandatory>
223 <#if maxlength gt 0><#local params='maxlength="${maxlength}"' /></#if>
224 <@input type='textarea' name='${inputName}' id='${inputName}' class='${cssClass!}' params=params>${value!}</@input>
225 </@formGroup>
226 </#macro>
227 <#macro boxSized col i18nTitleKey boxClass='box-primary' >
228 <#-- WARNING : macro boxSized is deprecated -->
229 <@columns md=col>
230 <@box class=boxClass>
231 <@boxHeader title=i18nTitleKey />
232 <@boxBody>
233 <#nested>
234 </@boxBody>
235 </@box>
236 </@columns>
237 </#macro>
238 <#macro rowBox boxClass='box-primary' col=12>
239 <#-- WARNING : macro rowBox is deprecated -->
240 <@row>
241 <@columns xs=12 sm=col>
242 <@box class=boxClass>
243 <#nested>
244 </@box>
245 </@columns>
246 </@row>
247 </#macro>
248 <#macro rowBoxHeader i18nTitleKey boxClass='box-primary' col=12>
249 <#-- WARNING : macro rowBoxHeader is deprecated -->
250 <@rowBox boxClass=boxClass col=col >
251 <@boxHeader i18nTitleKey=i18nTitleKey />
252 <@boxBody>
253 <#nested>
254 </@boxBody>
255 </@rowBox>
256 </#macro>
257 <#macro headerButtons>
258 <#-- WARNING : macro headerButtons is deprecated -->
259 <#nested>
260 </#macro>
261 <#macro listTabs type='tabs' id='' params=''>
262 <#-- WARNING : macro listTabs is deprecated -->
263 <@tabList style=type id=id params=params />
264 </#macro>
265 <#macro badge color='primary' badgeIcon='' title='' htmlEl='deprecated' type='deprecated' style='deprecated' class='deprecated' id='' params=''>
266 <#-- WARNING : macro badge is deprecated -->
267 <@tag color=color class=class title=title tagIcon=badgeIcon id=id />
268 </#macro>
269 <#-- DEPRECATED/RENAMED DATEPICKER MACROS -->
270 <#macro getDatePickerBootstrap idField language parse='false' showFormat='' format='d/m/Y'>
271 <#-- WARNING : macro deprecated, use @getDate -->
272 <@getDate idField=idField language=language format=format showFormat=showFormat />
273 </#macro>
274 <#macro getDatePickerBootstrapClass idForm language>
275 <@alert color='danger'>Not compatible with core v7. Please update the DatePicker code in the templates</@alert>
276 </#macro>
277 <#macro getDatePickerRangeBootstrap language showFormat=''>
278 <#-- WARNING : macro deprecated, use @getDateRange -->
279 <@getDateRange idField='date_begin' idEndField='date_end' language=language />
280 </#macro>
281 <#macro getDatePickerFlatPicker idField language >
282 <#-- WARNING : macro deprecated, use @getDate -->
283 <@getDate idField=idField language=language />
284 </#macro>
285 <#macro getDatePicker idField language >
286 <#-- WARNING : macro deprecated, use @getDate -->
287 <@getDate idField=idField language=language />
288 </#macro>
289 <#macro getDatePickerRange idFieldFrom idFieldTo language >
290 <#-- WARNING : macro deprecated, use @getDateRange -->
291 <@getDateRange idField=idFieldFrom idEndField=idFieldTo language=language />
292 </#macro>