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.

75 rindas
2.1KB

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