<?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;
/* theme_learts/editproduct.html.twig */
class __TwigTemplate_94d03b38a24f39fa35edfd381b6b76ec3aec4db7372be22d0ba580bb8368ffe8 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'maincontent' => [$this, 'block_maincontent'],
'footer' => [$this, 'block_footer'],
'bodyjavascript' => [$this, 'block_bodyjavascript'],
];
}
protected function doGetParent(array $context)
{
// line 1
return $this->loadTemplate((("theme_" . twig_constant("config_theme")) . "/base.html.twig"), "theme_learts/editproduct.html.twig", 1);
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "theme_learts/editproduct.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "theme_learts/editproduct.html.twig"));
$this->getParent($context)->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 3
public function block_maincontent($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "maincontent"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "maincontent"));
// line 4
echo " <div class=\"container\">
<iframe class=\"w-100\" id=\"chili-iframe\" onload=\"iFrameLoaded()\" src=\"";
// line 5
echo twig_escape_filter($this->env, (isset($context["url"]) || array_key_exists("url", $context) ? $context["url"] : (function () { throw new RuntimeError('Variable "url" does not exist.', 5, $this->source); })()), "html", null, true);
echo "\"></iframe>
<input type=\"hidden\" id=\"chilidocument_id\" value=\"";
// line 6
echo twig_escape_filter($this->env, (isset($context["docid"]) || array_key_exists("docid", $context) ? $context["docid"] : (function () { throw new RuntimeError('Variable "docid" does not exist.', 6, $this->source); })()), "html", null, true);
echo "\">
<button id=\"saveeditordocumentbutton\" disabled=\"disabled\" type=\"button\" class=\"btn btn-success btn-fill\" style=\"display:none;\" onclick=\"saveEditorDocument()\">Lagre</button>
</div>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 12
public function block_footer($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 15
public function block_bodyjavascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyjavascript"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyjavascript"));
// line 16
echo " <script>
\t\t\$.LoadingOverlay('show');
function saveEditorDocument() {
\t\t\ttoggleFullOverlayTo('show');
\t\t\tvar chilidocument_id = \$('#chilidocument_id').val();
\t\t\tvar chili_xml = editor.ExecuteFunction('document','GetTempXML');
\t\t\tvar postdata = 'chilidocument_id=' + chilidocument_id + '&chili_xml=' + encodeURIComponent(chili_xml);
\t\t\t\$.post('/saveChilidocumentToBasket', postdata, function(json) {
\t\t\t\ttry {
\t\t\t\t\tlogg(json);
\t\t\t\t\tupdateNumInBasket();
\t\t\t\t\ttoggleFullOverlayTo('hide');
\t\t\t\t} catch(e) {
\t\t\t\t\tconsole.log(e);
\t\t\t\t}
\t\t\t});
\t\t}
\t\tfunction loaddocument() {
\t\t\teditor.ExecuteFunction('document','OpenDocumentFromXml','";
// line 40
echo (isset($context["docxml"]) || array_key_exists("docxml", $context) ? $context["docxml"] : (function () { throw new RuntimeError('Variable "docxml" does not exist.', 40, $this->source); })());
echo "','','','');
}
\t\ttheInterval = setInterval(function() {
\t\t\tif (typeof editor !== 'undefined') {
clearInterval(theInterval);
\t\t\t\tloaddocument();
\t\t\t\ttoggleFullOverlayTo('hide');
} else {
\t\t\t\t// Wait 1 sec...
logg('Waiting for editor');
}
}, 1000);
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "theme_learts/editproduct.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 145 => 40, 119 => 16, 109 => 15, 91 => 12, 76 => 6, 72 => 5, 69 => 4, 59 => 3, 37 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'theme_' ~ constant('config_theme') ~ '/base.html.twig' %}
{% block maincontent %}
<div class=\"container\">
<iframe class=\"w-100\" id=\"chili-iframe\" onload=\"iFrameLoaded()\" src=\"{{ url }}\"></iframe>
<input type=\"hidden\" id=\"chilidocument_id\" value=\"{{ docid }}\">
<button id=\"saveeditordocumentbutton\" disabled=\"disabled\" type=\"button\" class=\"btn btn-success btn-fill\" style=\"display:none;\" onclick=\"saveEditorDocument()\">Lagre</button>
</div>
{% endblock %}
{% block footer %}
{% endblock %}
{% block bodyjavascript %}
<script>
\t\t\$.LoadingOverlay('show');
function saveEditorDocument() {
\t\t\ttoggleFullOverlayTo('show');
\t\t\tvar chilidocument_id = \$('#chilidocument_id').val();
\t\t\tvar chili_xml = editor.ExecuteFunction('document','GetTempXML');
\t\t\tvar postdata = 'chilidocument_id=' + chilidocument_id + '&chili_xml=' + encodeURIComponent(chili_xml);
\t\t\t\$.post('/saveChilidocumentToBasket', postdata, function(json) {
\t\t\t\ttry {
\t\t\t\t\tlogg(json);
\t\t\t\t\tupdateNumInBasket();
\t\t\t\t\ttoggleFullOverlayTo('hide');
\t\t\t\t} catch(e) {
\t\t\t\t\tconsole.log(e);
\t\t\t\t}
\t\t\t});
\t\t}
\t\tfunction loaddocument() {
\t\t\teditor.ExecuteFunction('document','OpenDocumentFromXml','{{ docxml | raw }}','','','');
}
\t\ttheInterval = setInterval(function() {
\t\t\tif (typeof editor !== 'undefined') {
clearInterval(theInterval);
\t\t\t\tloaddocument();
\t\t\t\ttoggleFullOverlayTo('hide');
} else {
\t\t\t\t// Wait 1 sec...
logg('Waiting for editor');
}
}, 1000);
</script>
{% endblock %}
", "theme_learts/editproduct.html.twig", "/var/www/html/webtoprint/SymfonyTemplate/templates/theme_learts/editproduct.html.twig");
}
}