customcheckboxlist.ftl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <#--
  2. /*
  3. * $Id: customcheckboxlist.ftl 6484 2009-12-14 02:33:28Z alvis.yeo $
  4. *
  5. * Licensed to the Apache Software Foundation (ASF) under one
  6. * or more contributor license agreements. See the NOTICE file
  7. * distributed with this work for additional information
  8. * regarding copyright ownership. The ASF licenses this file
  9. * to you under the Apache License, Version 2.0 (the
  10. * "License"); you may not use this file except in compliance
  11. * with the License. You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing,
  16. * software distributed under the License is distributed on an
  17. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18. * KIND, either express or implied. See the License for the
  19. * specific language governing permissions and limitations
  20. * under the License.
  21. */
  22. -->
  23. <#assign itemCount = 0/>
  24. <#if parameters.list?exists>
  25. <@s.iterator value="parameters.list">
  26. <#assign itemCount = itemCount + 1/>
  27. <#if parameters.listKey?exists>
  28. <#assign itemKey = stack.findValue(parameters.listKey)/>
  29. <#else>
  30. <#assign itemKey = stack.findValue('top')/>
  31. </#if>
  32. <#if parameters.listValue?exists>
  33. <#assign itemValue = stack.findString(parameters.listValue)/>
  34. <#else>
  35. <#assign itemValue = stack.findString('top')/>
  36. </#if>
  37. <#assign itemKeyStr=itemKey.toString() />
  38. <#if itemCount-1%15 == 0>
  39. <tr>
  40. </#if>
  41. <td>
  42. <input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
  43. <#if tag.contains(parameters.nameValue, itemKey)>checked="checked"<#rt/>
  44. </#if>
  45. <#if parameters.disabled?default(false)>disabled="disabled"<#rt/>
  46. </#if>
  47. <#if parameters.title?exists>title="${parameters.title?html}"<#rt/>
  48. </#if>
  49. <#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
  50. <#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
  51. />
  52. <label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label>
  53. </td>
  54. <#if itemCount%14 == 0>
  55. </tr>
  56. </#if>
  57. </@s.iterator>
  58. </tr>
  59. </table>
  60. <#else>
  61. &nbsp;
  62. </#if>