var/cache/dev/manitou-master2025.dtv-projects.com/twig/61/615be078f1ff15332ec302ad6ecf59d2.php line 60

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