mostly filebased Content Presentation System
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

81 行
2.4KB

  1. <form action="{{ @target }}" method="post">
  2. <repeat group="{{ @fields }}" key="{{ @name }}" value="{{ @info }}">
  3. <check if="{{ in_array(@info.type,['text','email']) }}">
  4. <true>
  5. <input
  6. name="{{ @name }}"
  7. id="{{ @name }}"
  8. type="{{ @info.type }}"
  9. size="{{ @info.length }}"
  10. value="{{ @info.value }}"
  11. placeholder="{{ @info.description }}"
  12. {{ @info.required ? 'required' : '' }} />
  13. <!--<label for="{{ @name }}">{{ @info.description }}</label>--><br>
  14. </true>
  15. </check>
  16. <check if="{{ @info.type == 'hidden' }}">
  17. <true>
  18. <input
  19. name="{{ @name }}"
  20. id="{{ @name }}"
  21. type="hidden"
  22. value="{{ @info.value }}"/>
  23. </true>
  24. </check>
  25. <check if="{{ @info.type == 'textarea' }}">
  26. <true>
  27. <textarea
  28. name="{{ @name }}"
  29. id="{{ @name }}"
  30. cols="{{ @info.cols }}"
  31. rows="{{ @info.rows }}"
  32. placeholder="{{ @info.description }}">{{ @info.value }}</textarea>
  33. <!--<label for="{{ @name }}">{{ @info.description }}</label>-->
  34. <br>
  35. </true>
  36. </check>
  37. <check if="{{ @info.type == 'checkbox' }}">
  38. <true>
  39. <repeat group="{{ @info.options }}" key="{{ @key }}" value="{{ @val }}">
  40. <input
  41. type="checkbox"
  42. id="{{ sprintf('%s[%s]',@name,@key) }}"
  43. name="{{ sprintf('%s[%s]',@name,@key) }}"
  44. value="true"
  45. {{ is_array(@info.checked) ? in_array(@key,@info.checked) ? 'checked' : '' : !strcmp(@key,@info.checked) ? 'checked' : '' }} />
  46. <label for="{{ sprintf('%s[%s]',@name,@key) }}">
  47. {{ @val }}</label><br>
  48. </repeat>
  49. </true>
  50. </check>
  51. <check if="{{ @info.type == 'radio' }}">
  52. <true>
  53. <div class="radio-group {{ @name }}">
  54. <repeat group="{{ @info.options }}" key="{{ @key }}" value="{{ @val }}">
  55. <input
  56. type="radio"
  57. id="{{ sprintf('%s-%s',@name,@key) }}"
  58. name="{{ sprintf('%s',@name) }}"
  59. value="{{ @val }}"
  60. {{ @info.required ? 'required' : '' }}
  61. {{ is_array(@info.checked) ? in_array(@key,@info.checked) ? 'checked' : '' : !strcmp(@key,@info.checked) ? 'checked' : '' }} />
  62. <label for="{{ sprintf('%s-%s',@name,@key) }}">
  63. {{ @val }}</label>
  64. </repeat>
  65. </div>
  66. </true>
  67. </check>
  68. <check if="{{ @info.type == 'custom' }}">
  69. <include href="{{ @info.template }}" with="elements={{ @info.el }},parent={{ @name }},options={{ @info.options }}" />
  70. </check>
  71. </repeat>
  72. <button type="submit" >{{ @submit_text ? : 'save' }}</button>
  73. </form>