<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;
/* @FoxHabbitBasis/Areas/element/basisbundle-element-button/variant-button.html.twig */
class __TwigTemplate_441bd6c05f937b78764934ee404dadec extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
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", "@FoxHabbitBasis/Areas/element/basisbundle-element-button/variant-button.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@FoxHabbitBasis/Areas/element/basisbundle-element-button/variant-button.html.twig"));
// line 1
$macros["wrap_macro"] = $this->macros["wrap_macro"] = $this->loadTemplate("@FoxHabbitBasis/Macro/wrap.html.twig", "@FoxHabbitBasis/Areas/element/basisbundle-element-button/variant-button.html.twig", 1)->unwrap();
// line 2
if ((((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 2, $this->source); })()) || FoxHabbit\BasisBundle\Tool\Url::isPublished($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h"))) || ((twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "show_unpublished_as_disabled", [], "any", true, true, true, 2)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "show_unpublished_as_disabled", [], "any", false, false, true, 2), false)) : (false)))) {
// line 3
echo " ";
if ((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 3, $this->source); })())) {
// line 4
echo " ";
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "t", ["placeholder" => "Linktext"]);
echo "
";
// line 5
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h", ["reload" => true]);
echo "
";
// line 6
echo $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "a", ["placeholder" => "#Anchor"]);
echo "
";
// line 7
if ((twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h"), "getElement", [], "method", false, false, true, 7) && !FoxHabbit\BasisBundle\Tool\Url::isPublished($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h")))) {
// line 8
echo " <div class=\"alert alert-danger\">Link-Ziel nicht gepflegt oder nicht veröffentlicht.</div>
";
}
// line 10
echo " ";
}
// line 11
echo " ";
if ((((isset($context["editmode"]) || array_key_exists("editmode", $context) ? $context["editmode"] : (function () { throw new RuntimeError('Variable "editmode" does not exist.', 11, $this->source); })()) || FoxHabbit\BasisBundle\Tool\Url::isPublished($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h"))) || ((twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "show_unpublished_as_disabled", [], "any", true, true, true, 11)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "show_unpublished_as_disabled", [], "any", false, false, true, 11), false)) : (false)))) {
// line 12
echo " ";
$context["href"] = FoxHabbit\BasisBundle\Tool\Url::getHref($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h"));
// line 13
echo " ";
$context["target"] = FoxHabbit\BasisBundle\Tool\Url::getTarget($this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "relation", "h"));
// line 14
echo " ";
$context["attr"] = ((twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "attr", [], "any", true, true, true, 14)) ? (_twig_default_filter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "attr", [], "any", false, false, true, 14), 14, $this->source), [])) : ([]));
// line 15
echo " ";
if ((((isset($context["target"]) || array_key_exists("target", $context) ? $context["target"] : (function () { throw new RuntimeError('Variable "target" does not exist.', 15, $this->source); })()) && ((isset($context["target"]) || array_key_exists("target", $context) ? $context["target"] : (function () { throw new RuntimeError('Variable "target" does not exist.', 15, $this->source); })()) != "_self")) && !((twig_get_attribute($this->env, $this->source, ($context["attr"] ?? null), "target", [], "any", true, true, true, 15)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["attr"] ?? null), "target", [], "any", false, false, true, 15), null)) : (null)))) {
// line 16
echo " ";
$context["attr"] = twig_array_merge($this->sandbox->ensureToStringAllowed((isset($context["attr"]) || array_key_exists("attr", $context) ? $context["attr"] : (function () { throw new RuntimeError('Variable "attr" does not exist.', 16, $this->source); })()), 16, $this->source), ["target" => (isset($context["target"]) || array_key_exists("target", $context) ? $context["target"] : (function () { throw new RuntimeError('Variable "target" does not exist.', 16, $this->source); })())]);
// line 17
echo " ";
}
// line 18
echo " ";
$context["anchor"] = twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "a"), "getValue", [], "method", false, false, true, 18);
// line 19
echo " ";
if (((isset($context["anchor"]) || array_key_exists("anchor", $context) ? $context["anchor"] : (function () { throw new RuntimeError('Variable "anchor" does not exist.', 19, $this->source); })()) && twig_matches("@^[^#].*@", (isset($context["anchor"]) || array_key_exists("anchor", $context) ? $context["anchor"] : (function () { throw new RuntimeError('Variable "anchor" does not exist.', 19, $this->source); })())))) {
// line 20
echo " ";
$context["anchor"] = ("#" . $this->sandbox->ensureToStringAllowed((isset($context["anchor"]) || array_key_exists("anchor", $context) ? $context["anchor"] : (function () { throw new RuntimeError('Variable "anchor" does not exist.', 20, $this->source); })()), 20, $this->source));
// line 21
echo " ";
}
// line 22
echo " ";
if (((isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 22, $this->source); })()) || (isset($context["anchor"]) || array_key_exists("anchor", $context) ? $context["anchor"] : (function () { throw new RuntimeError('Variable "anchor" does not exist.', 22, $this->source); })()))) {
// line 23
echo " ";
$context["wrapper"] = [["tag" => "a", "href" => ($this->sandbox->ensureToStringAllowed((isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 23, $this->source); })()), 23, $this->source) . $this->sandbox->ensureToStringAllowed((isset($context["anchor"]) || array_key_exists("anchor", $context) ? $context["anchor"] : (function () { throw new RuntimeError('Variable "anchor" does not exist.', 23, $this->source); })()), 23, $this->source)), "class" => ((twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "class", [], "any", true, true, true, 23)) ? (_twig_default_filter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "class", [], "any", false, false, true, 23), 23, $this->source), ".btn")) : (".btn")), "attr" => (isset($context["attr"]) || array_key_exists("attr", $context) ? $context["attr"] : (function () { throw new RuntimeError('Variable "attr" does not exist.', 23, $this->source); })())], ["tag" => "span", "class" => ""]];
// line 24
echo " ";
} else {
// line 25
echo " ";
$context["wrapper"] = [["tag" => "a", "class" => ((twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "class", [], "any", true, true, true, 25)) ? (_twig_default_filter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, ($context["config"] ?? null), "class", [], "any", false, false, true, 25), 25, $this->source), ".btn")) : (".btn")), "attr" => (isset($context["attr"]) || array_key_exists("attr", $context) ? $context["attr"] : (function () { throw new RuntimeError('Variable "attr" does not exist.', 25, $this->source); })())]];
// line 26
echo " ";
}
// line 27
echo " ";
echo twig_call_macro($macros["wrap_macro"], "macro_wrapperOpen", [(isset($context["wrapper"]) || array_key_exists("wrapper", $context) ? $context["wrapper"] : (function () { throw new RuntimeError('Variable "wrapper" does not exist.', 27, $this->source); })()), $context], 27, $context, $this->getSourceContext());
// line 28
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $this->extensions['Pimcore\Twig\Extension\DocumentEditableExtension']->renderEditable($context, "input", "t"), "getValue", [], "method", false, false, true, 28), 28, $this->source), "html", null, true);
// line 29
echo twig_call_macro($macros["wrap_macro"], "macro_wrapperClose", [(isset($context["wrapper"]) || array_key_exists("wrapper", $context) ? $context["wrapper"] : (function () { throw new RuntimeError('Variable "wrapper" does not exist.', 29, $this->source); })()), $context], 29, $context, $this->getSourceContext());
echo "
";
}
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "@FoxHabbitBasis/Areas/element/basisbundle-element-button/variant-button.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 127 => 29, 125 => 28, 122 => 27, 119 => 26, 116 => 25, 113 => 24, 110 => 23, 107 => 22, 104 => 21, 101 => 20, 98 => 19, 95 => 18, 92 => 17, 89 => 16, 86 => 15, 83 => 14, 80 => 13, 77 => 12, 74 => 11, 71 => 10, 67 => 8, 65 => 7, 61 => 6, 57 => 5, 52 => 4, 49 => 3, 47 => 2, 45 => 1,);
}
public function getSourceContext()
{
return new Source("{% import '@FoxHabbitBasis/Macro/wrap.html.twig' as wrap_macro %}
{% if editmode or foxhabbit_common_tool_url_is_published( pimcore_relation('h')) or config.show_unpublished_as_disabled|default(false) %}
{% if editmode %}
{{ pimcore_input('t',{placeholder:'Linktext'}) }}
{{ pimcore_relation('h',{'reload': true}) }}
{{ pimcore_input('a',{placeholder:'#Anchor'}) }}
{% if pimcore_relation('h').getElement() and not foxhabbit_common_tool_url_is_published( pimcore_relation('h')) %}
<div class=\"alert alert-danger\">Link-Ziel nicht gepflegt oder nicht veröffentlicht.</div>
{% endif %}
{% endif %}
{% if editmode or foxhabbit_common_tool_url_is_published( pimcore_relation('h')) or config.show_unpublished_as_disabled|default(false) %}
{% set href = foxhabbit_common_tool_url_get_href( pimcore_relation('h')) %}
{% set target = foxhabbit_common_tool_url_get_target( pimcore_relation('h')) %}
{% set attr = config.attr|default({}) %}
{% if target and target != '_self' and not attr.target|default(null) %}
{% set attr = attr|merge({target:target}) %}
{% endif %}
{% set anchor = pimcore_input('a').getValue() %}
{% if anchor and anchor matches('@^[^#].*@') %}
{% set anchor = '#' ~ anchor %}
{% endif %}
{% if href or anchor %}
{% set wrapper = [ {tag: 'a', href: href~anchor, class: config.class|default('.btn'), attr: attr}, {tag: 'span', class: ''} ] %}
{% else %}
{% set wrapper = [ {tag: 'a', class: config.class|default('.btn'), attr: attr} ] %}
{% endif %}
{{ wrap_macro.wrapperOpen( wrapper, _context) -}}
{{- pimcore_input('t').getValue() -}}
{{- wrap_macro.wrapperClose( wrapper, _context) }}
{% endif %}
{% endif %}
", "@FoxHabbitBasis/Areas/element/basisbundle-element-button/variant-button.html.twig", "/srv/httpd/vhosts/lorch-test/releases/51/bundles/FoxHabbit/BasisBundle/Resources/views/Areas/element/basisbundle-element-button/variant-button.html.twig");
}
public function checkSecurity()
{
static $tags = array("import" => 1, "if" => 2, "set" => 12);
static $filters = array("default" => 2, "merge" => 16, "escape" => 28);
static $functions = array("foxhabbit_common_tool_url_is_published" => 2, "pimcore_relation" => 2, "pimcore_input" => 4, "foxhabbit_common_tool_url_get_href" => 12, "foxhabbit_common_tool_url_get_target" => 13);
try {
$this->sandbox->checkSecurity(
['import', 'if', 'set'],
['default', 'merge', 'escape'],
['foxhabbit_common_tool_url_is_published', 'pimcore_relation', 'pimcore_input', 'foxhabbit_common_tool_url_get_href', 'foxhabbit_common_tool_url_get_target']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}