mostly filebased Content Presentation System
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

82 rindas
2.7KB

  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. {{ is_array(@info.required) ? (in_array(@key,@info.required) ? 'required' : '') : (!strcmp(@key,@info.required) ? 'required' : '') }} />
  47. <label for="{{ sprintf('%s[%s]',@name,@key) }}">
  48. {{ @val }}</label><br>
  49. </repeat>
  50. </true>
  51. </check>
  52. <check if="{{ @info.type == 'radio' }}">
  53. <true>
  54. <div class="radio-group {{ @name }}">
  55. <repeat group="{{ @info.options }}" key="{{ @key }}" value="{{ @val }}">
  56. <input
  57. type="radio"
  58. id="{{ sprintf('%s-%s',@name,@key) }}"
  59. name="{{ sprintf('%s',@name) }}"
  60. value="{{ @key }}"
  61. {{ @info.required ? 'required' : '' }}
  62. {{ is_array(@info.checked) ? (in_array(@key,@info.checked) ? 'checked' : '') : (!strcmp(@key,@info.checked) ? 'checked' : '') }} />
  63. <label for="{{ sprintf('%s-%s',@name,@key) }}">
  64. {{ @val }}</label>
  65. </repeat>
  66. </div>
  67. </true>
  68. </check>
  69. <check if="{{ @info.type == 'custom' }}">
  70. <include href="{{ @info.template }}" with="elements={{ @info.el }},parent={{ @name }},options={{ @info.options }}" />
  71. </check>
  72. </repeat>
  73. <button type="submit" >{{ @submit_text ? : 'save' }}</button>
  74. </form>