c3536cdec3e321d3569e6b10f9d5dec8656ef13e9b9c660e76a460829e79a7b9.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. /* forms/fields/datetime/datetime.html.twig */
  3. class __TwigTemplate_330cf2a06b94650c369ccc8a096e33c98c44dfc542496612fd85d20cdd694b44 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. // line 1
  9. $this->parent = $this->loadTemplate("forms/field.html.twig", "forms/fields/datetime/datetime.html.twig", 1);
  10. $this->blocks = array(
  11. 'input' => array($this, 'block_input'),
  12. 'input_attributes' => array($this, 'block_input_attributes'),
  13. );
  14. }
  15. protected function doGetParent(array $context)
  16. {
  17. return "forms/field.html.twig";
  18. }
  19. protected function doDisplay(array $context, array $blocks = array())
  20. {
  21. // line 3
  22. $context["value"] = (((null === ($context["value"] ?? null))) ? ($this->getAttribute(($context["field"] ?? null), "default", array())) : (($context["value"] ?? null)));
  23. // line 4
  24. $context["default_php_dateformat"] = $this->getAttribute(($context["admin"] ?? null), "guessDateFormat", array(0 => ($context["value"] ?? null)), "method");
  25. // line 5
  26. $context["php_dateformat"] = (($this->getAttribute(($context["field"] ?? null), "format", array())) ? ($this->getAttribute(($context["field"] ?? null), "format", array())) : ((($this->getAttribute($this->getAttribute(($context["admin"] ?? null), "page", array()), "dateformat", array())) ? ($this->getAttribute($this->getAttribute(($context["admin"] ?? null), "page", array()), "dateformat", array())) : ((($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "system", array()), "pages", array()), "dateformat", array()), "default", array())) ? ($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "system", array()), "pages", array()), "dateformat", array()), "default", array())) : (($context["default_php_dateformat"] ?? null)))))));
  27. // line 6
  28. $context["js_dateformat"] = $this->getAttribute(($context["admin"] ?? null), "dateformatToMomentJS", array(0 => ($context["php_dateformat"] ?? null)), "method");
  29. // line 7
  30. $context["value"] = (((null === ($context["value"] ?? null))) ? (($context["value"] ?? null)) : (twig_date_format_filter($this->env, ($context["value"] ?? null), ($context["php_dateformat"] ?? null))));
  31. // line 1
  32. $this->parent->display($context, array_merge($this->blocks, $blocks));
  33. }
  34. // line 9
  35. public function block_input($context, array $blocks = array())
  36. {
  37. // line 10
  38. echo "<div class=\"form-input-wrapper datetime-picker-wrapper ";
  39. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  40. echo "\">
  41. <input
  42. name=\"";
  43. // line 12
  44. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->fieldNameFilter((($context["scope"] ?? null) . $this->getAttribute(($context["field"] ?? null), "name", array()))), "html", null, true);
  45. echo "\"
  46. value=\"";
  47. // line 13
  48. echo twig_escape_filter($this->env, twig_join_filter(($context["value"] ?? null), ", "), "html", null, true);
  49. echo "\"
  50. ";
  51. // line 14
  52. $this->displayBlock('input_attributes', $context, $blocks);
  53. // line 21
  54. echo " />
  55. <span class=\"field-icons\">
  56. <i class=\"fa fa-fw fa-calendar\"></i>
  57. </span>
  58. </div>
  59. ";
  60. }
  61. // line 14
  62. public function block_input_attributes($context, array $blocks = array())
  63. {
  64. // line 15
  65. echo " type=\"text\"
  66. data-grav-datetime=\"";
  67. // line 16
  68. echo twig_escape_filter($this->env, twig_jsonencode_filter(array("format" => ($context["js_dateformat"] ?? null))), "html_attr");
  69. echo "\"
  70. ";
  71. // line 17
  72. if ($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "min", array())) {
  73. echo "min=\"";
  74. echo twig_escape_filter($this->env, (((null === $this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "min", array()))) ? ($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "min", array())) : (twig_date_format_filter($this->env, $this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "min", array()), ($context["php_dateformat"] ?? null)))), "html", null, true);
  75. echo "\"";
  76. }
  77. // line 18
  78. echo " ";
  79. if ($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "max", array())) {
  80. echo "max=\"";
  81. echo twig_escape_filter($this->env, (((null === $this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "max", array()))) ? ($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "max", array())) : (twig_date_format_filter($this->env, $this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "max", array()), ($context["php_dateformat"] ?? null)))), "html", null, true);
  82. echo "\"";
  83. }
  84. // line 19
  85. echo " ";
  86. $this->displayParentBlock("input_attributes", $context, $blocks);
  87. echo "
  88. ";
  89. }
  90. public function getTemplateName()
  91. {
  92. return "forms/fields/datetime/datetime.html.twig";
  93. }
  94. public function isTraitable()
  95. {
  96. return false;
  97. }
  98. public function getDebugInfo()
  99. {
  100. return array ( 91 => 19, 84 => 18, 78 => 17, 74 => 16, 71 => 15, 68 => 14, 59 => 21, 57 => 14, 53 => 13, 49 => 12, 43 => 10, 40 => 9, 36 => 1, 34 => 7, 32 => 6, 30 => 5, 28 => 4, 26 => 3, 11 => 1,);
  101. }
  102. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  103. public function getSource()
  104. {
  105. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  106. return $this->getSourceContext()->getCode();
  107. }
  108. public function getSourceContext()
  109. {
  110. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  111. {% set value = (value is null ? field.default : value) %}
  112. {% set default_php_dateformat = admin.guessDateFormat(value) %}
  113. {% set php_dateformat = field.format ?: admin.page.dateformat ?: config.system.pages.dateformat.default ?: default_php_dateformat %}
  114. {% set js_dateformat = admin.dateformatToMomentJS(php_dateformat) %}
  115. {% set value = (value is null ? value : value|date(php_dateformat)) %}
  116. {% block input %}
  117. <div class=\"form-input-wrapper datetime-picker-wrapper {{ field.size }}\">
  118. <input
  119. name=\"{{ (scope ~ field.name)|fieldName }}\"
  120. value=\"{{ value|raw|join(', ') }}\"
  121. {% block input_attributes %}
  122. type=\"text\"
  123. data-grav-datetime=\"{{ {'format': js_dateformat} | json_encode | e('html_attr') }}\"
  124. {% if field.validate.min %}min=\"{{ (field.validate.min is null ? field.validate.min : field.validate.min|date(php_dateformat)) }}\"{% endif %}
  125. {% if field.validate.max %}max=\"{{ (field.validate.max is null ? field.validate.max : field.validate.max|date(php_dateformat)) }}\"{% endif %}
  126. {{ parent() }}
  127. {% endblock %}
  128. />
  129. <span class=\"field-icons\">
  130. <i class=\"fa fa-fw fa-calendar\"></i>
  131. </span>
  132. </div>
  133. {% endblock %}
  134. ", "forms/fields/datetime/datetime.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/datetime/datetime.html.twig");
  135. }
  136. }