<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* platform/component/atom/link_img_static.html.twig */
class __TwigTemplate_f43a237aca5e3734c4e775599c43aa68 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "platform/component/atom/link_img_static.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "platform/component/atom/link_img_static.html.twig"));
// line 20
yield "
";
// line 23
if ( !array_key_exists("componentKey", $context)) {
// line 24
yield " ";
$context["componentKey"] = "link_img_static";
}
// line 26
$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); })()));
// line 27
yield "
";
// line 28
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); })()))) {
// line 29
yield " ";
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))) {
// line 30
yield " ";
$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));
// line 31
yield " ";
if ( !((isset($context["url"]) || array_key_exists("url", $context) ? $context["url"] : (function () { throw new RuntimeError('Variable "url" does not exist.', 31, $this->source); })()) === "")) {
// line 32
yield " <a href=\"";
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);
yield "\"
";
// line 34
yield " ";
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)) {
yield "target=\"";
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);
yield "\"";
}
yield ">
";
}
// line 36
yield " ";
}
// line 37
yield "
";
// line 38
$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); })())));
// line 39
yield "
";
// line 40
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) === "")) {
// line 41
yield " <div style=\"width: 150px; height: 150px; line-height: 150px; text-align: center; border: 2px dashed grey\">
<small>";
// line 42
yield $this->extensions['App\Twig\TwigExtension']->customTrans("ajouter une image dans dtv");
yield "</small>
</div>
";
} else {
// line 46
yield " <img src=\"";
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);
yield "\" alt=\"";
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);
yield "\"
class=\"img-fluid ";
// line 47
if (CoreExtension::getAttribute($this->env, $this->source, ($context["img"] ?? null), "class", [], "any", true, true, false, 47)) {
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);
}
yield "\">
";
}
// line 49
yield "
";
// line 50
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); })())))) {
// line 51
yield " </a>
";
}
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "platform/component/atom/link_img_static.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{# configuration example
###########
class: col-md-4
enabled: true
link:
enabled: false
tel: ''
mailto: ''
url: ''
route: ''
params: ''
class: ''
target: _self
img:
url: ''
alt: 'test test'
class: ''
#}
{% if componentKey is not defined %}
{% set componentKey = \"link_img_static\" %}
{% endif %}
{% set item_config = generateComponentOptions(value, componentKey)%}
{% if canDisplayComponentByAcl(item_config) %}
{% if value.link.enabled is not defined or value.link.enabled %}
{% set url = getItemLink(value.link)%}
{% if url is not same as('') %}
<a href=\"{{ url }}\"
{# {% if value.link.class is defined %}class=\"{{ value.link.class }}\"{% endif %}#}
{% if value.link.target is defined %}target=\"{{ value.link.target }}\"{% endif %}>
{% endif %}
{% endif %}
{% set img = value.img is defined ? value.img : value %}
{% if img.url is same as('') %}
<div style=\"width: 150px; height: 150px; line-height: 150px; text-align: center; border: 2px dashed grey\">
<small>{{ 'ajouter une image dans dtv'|trans }}</small>
</div>
{% else %}
<img src=\"{{ path('static_project_file', {'fileName': img.url}) }}\" alt=\"{{ img.alt }}\"
class=\"img-fluid {% if img.class is defined %}{{ img.class }}{% endif %}\">
{% endif %}
{% if url is defined and url is not null %}
</a>
{% endif %}
{% endif %}
", "platform/component/atom/link_img_static.html.twig", "/var/www/dtv-preprod/current/templates/platform/component/atom/link_img_static.html.twig");
}
}