37f41e0b088533c946e465f472cebd1b732df5de6cea09669fff6096f730ea88.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. /* forms/fields/pagemedia/pagemedia.html.twig */
  3. class __TwigTemplate_2632738a5f1bdeca1e559f4187bcaa38fa37cb75fe64bd53635ee50ce53262d6 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = false;
  9. $this->blocks = array(
  10. );
  11. }
  12. protected function doDisplay(array $context, array $blocks = array())
  13. {
  14. // line 1
  15. $context["value"] = (((null === ($context["value"] ?? null))) ? ($this->getAttribute(($context["field"] ?? null), "default", array())) : (($context["value"] ?? null)));
  16. // line 2
  17. echo "
  18. ";
  19. // line 3
  20. if ($this->getAttribute(($context["context"] ?? null), "folderExists", array())) {
  21. // line 4
  22. echo "<div class=\"form-field grid vertical ";
  23. if ($this->getAttribute(($context["field"] ?? null), "classes", array(), "any", true, true)) {
  24. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  25. }
  26. echo "\">
  27. <div class=\"form-label\">
  28. <label>";
  29. // line 6
  30. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  31. echo "</label>
  32. </div>
  33. <div class=\"form-data form-uploads-wrapper\">
  34. ";
  35. // line 9
  36. $context["uploadLimit"] = (($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "config", array()), "system", array()), "media", array()), "upload_limit", array()) / 1024) / 1024);
  37. // line 10
  38. echo " ";
  39. $context["dropzoneSettings"] = array("maxFileSize" => ($context["uploadLimit"] ?? null));
  40. // line 11
  41. echo " <div id=\"grav-dropzone\"
  42. class=\"dropzone\"
  43. data-media-url=\"";
  44. // line 13
  45. echo twig_escape_filter($this->env, ($context["base_url"] ?? null), "html", null, true);
  46. echo "/media/";
  47. echo twig_escape_filter($this->env, twig_trim_filter($this->getAttribute(($context["admin"] ?? null), "route", array()), "/"), "html", null, true);
  48. echo ".json\"
  49. data-media-local=\"";
  50. // line 14
  51. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->rtrimFilter(($context["base_url_relative_frontend"] ?? null), "/"), "html", null, true);
  52. echo "/";
  53. echo twig_escape_filter($this->env, twig_trim_filter($this->getAttribute(($context["admin"] ?? null), "route", array()), "/"), "html", null, true);
  54. echo "\"
  55. data-media-path=\"";
  56. // line 15
  57. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->urlFunc($this->getAttribute(($context["context"] ?? null), "relativePagePath", array())), "html", null, true);
  58. echo "\"
  59. data-dropzone-options=\"";
  60. // line 16
  61. echo twig_escape_filter($this->env, twig_jsonencode_filter(($context["dropzoneSettings"] ?? null)), "html_attr");
  62. echo "\"
  63. data-dropzone-field=\"";
  64. // line 17
  65. 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);
  66. echo "\"></div>
  67. ";
  68. // line 19
  69. if (($this->getAttribute($this->getAttribute(($context["admin"] ?? null), "session", array()), "expert", array()) == "0")) {
  70. // line 20
  71. echo " <input type=\"hidden\" name=\"";
  72. 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);
  73. echo "\" value=\"";
  74. echo twig_escape_filter($this->env, ($context["value"] ?? null));
  75. echo "\" />
  76. ";
  77. }
  78. // line 22
  79. echo " </div>
  80. </div>
  81. ";
  82. } else {
  83. // line 25
  84. echo "<div class=\"form-tab\">
  85. <div class=\"form-field\">
  86. <div class=\"form-label\">
  87. ";
  88. // line 28
  89. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.CANNOT_ADD_MEDIA_FILES_PAGE_NOT_SAVED"), "html", null, true);
  90. echo "
  91. </div>
  92. </div>
  93. </div>
  94. ";
  95. }
  96. }
  97. public function getTemplateName()
  98. {
  99. return "forms/fields/pagemedia/pagemedia.html.twig";
  100. }
  101. public function isTraitable()
  102. {
  103. return false;
  104. }
  105. public function getDebugInfo()
  106. {
  107. return array ( 94 => 28, 89 => 25, 84 => 22, 76 => 20, 74 => 19, 69 => 17, 65 => 16, 61 => 15, 55 => 14, 49 => 13, 45 => 11, 42 => 10, 40 => 9, 34 => 6, 26 => 4, 24 => 3, 21 => 2, 19 => 1,);
  108. }
  109. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  110. public function getSource()
  111. {
  112. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  113. return $this->getSourceContext()->getCode();
  114. }
  115. public function getSourceContext()
  116. {
  117. return new Twig_Source("{% set value = (value is null ? field.default : value) %}
  118. {% if context.folderExists %}
  119. <div class=\"form-field grid vertical {% if field.classes is defined %}{{ field.classes }}{% endif %}\">
  120. <div class=\"form-label\">
  121. <label>{{ field.label|tu }}</label>
  122. </div>
  123. <div class=\"form-data form-uploads-wrapper\">
  124. {% set uploadLimit = grav.config.system.media.upload_limit / 1024 / 1024 %}
  125. {% set dropzoneSettings = { maxFileSize: uploadLimit } %}
  126. <div id=\"grav-dropzone\"
  127. class=\"dropzone\"
  128. data-media-url=\"{{ base_url }}/media/{{ admin.route|trim('/') }}.json\"
  129. data-media-local=\"{{ base_url_relative_frontend|rtrim('/') }}/{{ admin.route|trim('/') }}\"
  130. data-media-path=\"{{ url(context.relativePagePath) }}\"
  131. data-dropzone-options=\"{{ dropzoneSettings|json_encode|e('html_attr') }}\"
  132. data-dropzone-field=\"{{ (scope ~ field.name)|fieldName }}\"></div>
  133. {% if admin.session.expert == '0' %}
  134. <input type=\"hidden\" name=\"{{ (scope ~ field.name)|fieldName }}\" value=\"{{ value|e }}\" />
  135. {% endif %}
  136. </div>
  137. </div>
  138. {% else %}
  139. <div class=\"form-tab\">
  140. <div class=\"form-field\">
  141. <div class=\"form-label\">
  142. {{ \"PLUGIN_ADMIN.CANNOT_ADD_MEDIA_FILES_PAGE_NOT_SAVED\"|tu }}
  143. </div>
  144. </div>
  145. </div>
  146. {% endif %}
  147. ", "forms/fields/pagemedia/pagemedia.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/pagemedia/pagemedia.html.twig");
  148. }
  149. }