mostly filebased Content Presentation System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 satır
2.5KB

  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="{{ array_key_exists('length',@info) ? @info.length : 20 }}"
  10. value="{{ array_key_exists('value',@info) ? @info.value : '' }}"
  11. placeholder="{{ @info.description }}"
  12. {{ (array_key_exists('required',@info) && @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="{{ @key }}"
  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>