var/cache/dev/manitou-master2025.dtv-projects.com/twig/06/06a23279c0cbc86c4116164b9d24820b.php line 64

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* platform/component/atom/link_img_static.html.twig */
  16. class __TwigTemplate_05177c616bf7ee76cf73130d7d29f2c8 extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->parent = false;
  28. $this->blocks = [
  29. ];
  30. }
  31. protected function doDisplay(array $context, array $blocks = []): iterable
  32. {
  33. $macros = $this->macros;
  34. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "platform/component/atom/link_img_static.html.twig"));
  36. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "platform/component/atom/link_img_static.html.twig"));
  38. // line 20
  39. yield "
  40. ";
  41. // line 23
  42. if ((($tmp = !array_key_exists("componentKey", $context)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  43. // line 24
  44. yield " ";
  45. $context["componentKey"] = "link_img_static";
  46. }
  47. // line 26
  48. $context["item_config"] = $this->env->getRuntime('App\Twig\Runtime\PlatformComponentRuntime')->generateComponentOptions((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 26, $this->source); })()), (isset($context["componentKey"]) || array_key_exists("componentKey", $context) ? $context["componentKey"] : (function () { throw new RuntimeError('Variable "componentKey" does not exist.', 26, $this->source); })()));
  49. // line 27
  50. yield "
  51. ";
  52. // line 28
  53. if ((($tmp = $this->env->getRuntime('App\Twig\Runtime\AclRuntime')->canDisplayComponentByAcl((isset($context["item_config"]) || array_key_exists("item_config", $context) ? $context["item_config"] : (function () { throw new RuntimeError('Variable "item_config" does not exist.', 28, $this->source); })()))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  54. // line 29
  55. yield " ";
  56. if (( !CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["value"] ?? null), "link", [], "any", false, true, false, 29), "enabled", [], "any", true, true, false, 29) || CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 29, $this->source); })()), "link", [], "any", false, false, false, 29), "enabled", [], "any", false, false, false, 29))) {
  57. // line 30
  58. yield " ";
  59. $context["url"] = $this->env->getRuntime('App\Twig\Runtime\TwigRuntime')->getItemLink(CoreExtension::getAttribute($this->env, $this->source, (isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 30, $this->source); })()), "link", [], "any", false, false, false, 30));
  60. // line 31
  61. yield " ";
  62. if ((($tmp = !((isset($context["url"]) || array_key_exists("url", $context) ? $context["url"] : (function () { throw new RuntimeError('Variable "url" does not exist.', 31, $this->source); })()) === "")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  63. // line 32
  64. yield " <a href=\"";
  65. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["url"]) || array_key_exists("url", $context) ? $context["url"] : (function () { throw new RuntimeError('Variable "url" does not exist.', 32, $this->source); })()), "html", null, true);
  66. yield "\"
  67. ";
  68. // line 34
  69. yield " ";
  70. if (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["value"] ?? null), "link", [], "any", false, true, false, 34), "target", [], "any", true, true, false, 34)) {
  71. yield "target=\"";
  72. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 34, $this->source); })()), "link", [], "any", false, false, false, 34), "target", [], "any", false, false, false, 34), "html", null, true);
  73. yield "\"";
  74. }
  75. yield ">
  76. ";
  77. }
  78. // line 36
  79. yield " ";
  80. }
  81. // line 37
  82. yield "
  83. ";
  84. // line 38
  85. $context["img"] = ((CoreExtension::getAttribute($this->env, $this->source, ($context["value"] ?? null), "img", [], "any", true, true, false, 38)) ? (CoreExtension::getAttribute($this->env, $this->source, (isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 38, $this->source); })()), "img", [], "any", false, false, false, 38)) : ((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 38, $this->source); })())));
  86. // line 39
  87. yield "
  88. ";
  89. // line 40
  90. if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["img"]) || array_key_exists("img", $context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.', 40, $this->source); })()), "url", [], "any", false, false, false, 40) === "")) {
  91. // line 41
  92. yield " <div style=\"width: 150px; height: 150px; line-height: 150px; text-align: center; border: 2px dashed grey\">
  93. <small>";
  94. // line 42
  95. yield $this->extensions['App\Twig\TwigExtension']->customTrans("ajouter une image dans dtv");
  96. yield "</small>
  97. </div>
  98. ";
  99. } else {
  100. // line 46
  101. yield " <img src=\"";
  102. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("static_project_file", ["fileName" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["img"]) || array_key_exists("img", $context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.', 46, $this->source); })()), "url", [], "any", false, false, false, 46)]), "html", null, true);
  103. yield "\" alt=\"";
  104. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["img"]) || array_key_exists("img", $context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.', 46, $this->source); })()), "alt", [], "any", false, false, false, 46), "html", null, true);
  105. yield "\"
  106. class=\"img-fluid ";
  107. // line 47
  108. if (CoreExtension::getAttribute($this->env, $this->source, ($context["img"] ?? null), "class", [], "any", true, true, false, 47)) {
  109. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["img"]) || array_key_exists("img", $context) ? $context["img"] : (function () { throw new RuntimeError('Variable "img" does not exist.', 47, $this->source); })()), "class", [], "any", false, false, false, 47), "html", null, true);
  110. }
  111. yield "\">
  112. ";
  113. }
  114. // line 49
  115. yield "
  116. ";
  117. // line 50
  118. if ((array_key_exists("url", $context) && !(null === (isset($context["url"]) || array_key_exists("url", $context) ? $context["url"] : (function () { throw new RuntimeError('Variable "url" does not exist.', 50, $this->source); })())))) {
  119. // line 51
  120. yield " </a>
  121. ";
  122. }
  123. }
  124. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  125. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  126. yield from [];
  127. }
  128. /**
  129. * @codeCoverageIgnore
  130. */
  131. public function getTemplateName(): string
  132. {
  133. return "platform/component/atom/link_img_static.html.twig";
  134. }
  135. /**
  136. * @codeCoverageIgnore
  137. */
  138. public function isTraitable(): bool
  139. {
  140. return false;
  141. }
  142. /**
  143. * @codeCoverageIgnore
  144. */
  145. public function getDebugInfo(): array
  146. {
  147. return array ( 132 => 51, 130 => 50, 127 => 49, 120 => 47, 113 => 46, 106 => 42, 103 => 41, 101 => 40, 98 => 39, 96 => 38, 93 => 37, 90 => 36, 80 => 34, 75 => 32, 72 => 31, 69 => 30, 66 => 29, 64 => 28, 61 => 27, 59 => 26, 55 => 24, 53 => 23, 48 => 20,);
  148. }
  149. public function getSourceContext(): Source
  150. {
  151. return new Source("{# configuration example
  152. ###########
  153. class: col-md-4
  154. enabled: true
  155. link:
  156. enabled: false
  157. tel: ''
  158. mailto: ''
  159. url: ''
  160. route: ''
  161. params: ''
  162. class: ''
  163. target: _self
  164. img:
  165. url: ''
  166. alt: 'test test'
  167. class: ''
  168. #}
  169. {% if componentKey is not defined %}
  170. {% set componentKey = \"link_img_static\" %}
  171. {% endif %}
  172. {% set item_config = generateComponentOptions(value, componentKey)%}
  173. {% if canDisplayComponentByAcl(item_config) %}
  174. {% if value.link.enabled is not defined or value.link.enabled %}
  175. {% set url = getItemLink(value.link)%}
  176. {% if url is not same as('') %}
  177. <a href=\"{{ url }}\"
  178. {# {% if value.link.class is defined %}class=\"{{ value.link.class }}\"{% endif %}#}
  179. {% if value.link.target is defined %}target=\"{{ value.link.target }}\"{% endif %}>
  180. {% endif %}
  181. {% endif %}
  182. {% set img = value.img is defined ? value.img : value %}
  183. {% if img.url is same as('') %}
  184. <div style=\"width: 150px; height: 150px; line-height: 150px; text-align: center; border: 2px dashed grey\">
  185. <small>{{ 'ajouter une image dans dtv'|trans }}</small>
  186. </div>
  187. {% else %}
  188. <img src=\"{{ path('static_project_file', {'fileName': img.url}) }}\" alt=\"{{ img.alt }}\"
  189. class=\"img-fluid {% if img.class is defined %}{{ img.class }}{% endif %}\">
  190. {% endif %}
  191. {% if url is defined and url is not null %}
  192. </a>
  193. {% endif %}
  194. {% endif %}
  195. ", "platform/component/atom/link_img_static.html.twig", "/var/www/dtv-preprod/current/templates/platform/component/atom/link_img_static.html.twig");
  196. }
  197. }