<?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;
use Twig\TemplateWrapper;

/* extension/ocmodeditor41x/admin/view/template/modification/editor.twig */
class __TwigTemplate_70169378df6eac86268de2aa4e1a5d2d extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $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 = []): iterable
    {
        $macros = $this->macros;
        // line 1
        yield ($context["header"] ?? null);
        yield ($context["column_left"] ?? null);
        yield "
<div id=\"content\">
  <div class=\"page-header\">
    <div class=\"container-fluid\">
      <div class=\"float-end\">
        <button type=\"button\" id=\"button-erase-theme\" data-toggle=\"tooltip\" title=\"";
        // line 6
        yield ($context["button_erase_theme"] ?? null);
        yield "\" class=\"btn btn-success\" data-loading-text=\"";
        yield ($context["text_erasing"] ?? null);
        yield "\"><i class=\"fa fa-eraser\"></i></button>
        <button type=\"button\" id=\"button-erase-data\" data-toggle=\"tooltip\" title=\"";
        // line 7
        yield ($context["button_erase_data"] ?? null);
        yield "\" class=\"btn btn-warning\" data-loading-text=\"";
        yield ($context["text_erasing"] ?? null);
        yield "\"><i class=\"fa fa-eraser\"></i></button>
        <button type=\"button\" id=\"button-erase-image\" data-toggle=\"tooltip\" title=\"";
        // line 8
        yield ($context["button_erase_image"] ?? null);
        yield "\" class=\"btn btn-danger\" data-loading-text=\"";
        yield ($context["text_erasing"] ?? null);
        yield "\"><i class=\"fa fa-eraser\"></i></button>
        <button type=\"button\" id=\"button-save\" data-toggle=\"tooltip\" title=\"";
        // line 9
        yield ($context["button_save"] ?? null);
        yield "\" class=\"btn btn-primary\" data-loading-text=\"";
        yield ($context["text_loading"] ?? null);
        yield "\"><i class=\"fa fa-save\"></i></button>
        <a href=\"";
        // line 10
        yield ($context["return"] ?? null);
        yield "\" data-toggle=\"tooltip\" title=\"";
        yield ($context["button_return"] ?? null);
        yield "\" class=\"btn btn-default\"><i class=\"fa fa-reply\"></i></a>
      </div>
      <h1>";
        // line 12
        yield ($context["heading_title"] ?? null);
        yield "</h1>
      <ul class=\"breadcrumb\">
        ";
        // line 14
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($context["breadcrumbs"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["breadcrumb"]) {
            // line 15
            yield "        <li><a href=\"";
            yield CoreExtension::getAttribute($this->env, $this->source, $context["breadcrumb"], "href", [], "any", false, false, false, 15);
            yield "\">";
            yield CoreExtension::getAttribute($this->env, $this->source, $context["breadcrumb"], "text", [], "any", false, false, false, 15);
            yield "</a></li>
        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['breadcrumb'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 17
        yield "      </ul>
    </div>
  </div>
  <div class=\"container-fluid\">
    <div class=\"row\">
      <div >
        <div class=\"card\">
          <div class=\"card-header\"><i class=\"fa-solid fa-filter\"></i> ";
        // line 24
        yield ($context["text_filter"] ?? null);
        yield "</div>
          <div class=\"card-body\">
        <form action=\"\" method=\"post\" enctype=\"multipart/form-data\" id=\"form-modification\" class=\"form-horizontal\">
          <fieldset>
            <legend>";
        // line 28
        yield ($context["text_xml_code"] ?? null);
        yield "</legend>
            <div class=\"form-group\">
              <div class=\"col-sm-12\">
                <pre id=\"code\" style=\"width:100% !important; height:480px; position:relative; font-size:1.1em;\">";
        // line 31
        yield ($context["xml"] ?? null);
        yield "</pre>
                <input type=\"hidden\" name=\"modification_id\" value=\"";
        // line 32
        yield ($context["modification_id"] ?? null);
        yield "\" />
              </div>
            </div>
          </fieldset>
        </form>
      </div>
    </div>
  </div>
</div>

  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
  <script type=\"text/javascript\">
    var editor = ace.edit(\"code\");

    editor.setTheme(\"ace/theme/cobalt\");
    editor.setOptions({
        wrap: true,
        useSoftTabs: true,
    });
    editor.getSession().setMode(\"ace/mode/xml\");

  \$('#button-erase-theme').on('click', function() {
    \$('.alert').remove();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.erase_cache_theme&user_token=";
        // line 56
        yield ($context["user_token"] ?? null);
        yield "',
      dataType: 'json',
      cache: false,
      beforeSend: function() {
        \$('#button-erase-theme').button('loading');
      },
      complete: function() {
        \$('#button-erase-theme').button('reset');
      },
      success: function(json) {
          if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
  \$('#button-erase-data').on('click', function() {
    \$('.alert').remove();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.erase_cache_data&user_token=";
        // line 81
        yield ($context["user_token"] ?? null);
        yield "',
      dataType: 'json',
      cache: false,
      beforeSend: function() {
        \$('#button-erase-data').button('loading');
      },
      complete: function() {
        \$('#button-erase-data').button('reset');
      },
      success: function(json) {
          if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
  \$('#button-erase-image').on('click', function() {
    \$('.alert').remove();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.erase_cache_image&user_token=";
        // line 106
        yield ($context["user_token"] ?? null);
        yield "',
      dataType: 'json',
      cache: false,
      beforeSend: function() {
        \$('#button-erase-image').button('loading');
      },
      complete: function() {
        \$('#button-erase-image').button('reset');
      },
      success: function(json) {
           if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
  \$('#button-save').on('click', function(){
    \$('.alert').remove();
    var id = \$('input[name=\"modification_id\"]').val();
    var xml_code = editor.getValue();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.save&user_token=";
        // line 133
        yield ($context["user_token"] ?? null);
        yield "',
      type: 'post',
      dataType: 'json',
      data: { modification_id: id, xml: xml_code },
      cache: false,
      beforeSend: function() {
        \$('#button-save').button('loading');
      },
      complete: function() {
        \$('#button-save').button('reset');
      },
      success: function(json) {
        \$('.alert-dismissible').remove();

            if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
          if (id == 0) { location.href = 'index.php?route=marketplace/modification&user_token=";
        // line 152
        yield ($context["user_token"] ?? null);
        yield "'; }
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
//--></script> 
";
        // line 161
        yield ($context["footer"] ?? null);
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "extension/ocmodeditor41x/admin/view/template/modification/editor.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  275 => 161,  263 => 152,  241 => 133,  211 => 106,  183 => 81,  155 => 56,  128 => 32,  124 => 31,  118 => 28,  111 => 24,  102 => 17,  91 => 15,  87 => 14,  82 => 12,  75 => 10,  69 => 9,  63 => 8,  57 => 7,  51 => 6,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{{ header }}{{ column_left }}
<div id=\"content\">
  <div class=\"page-header\">
    <div class=\"container-fluid\">
      <div class=\"float-end\">
        <button type=\"button\" id=\"button-erase-theme\" data-toggle=\"tooltip\" title=\"{{ button_erase_theme }}\" class=\"btn btn-success\" data-loading-text=\"{{ text_erasing }}\"><i class=\"fa fa-eraser\"></i></button>
        <button type=\"button\" id=\"button-erase-data\" data-toggle=\"tooltip\" title=\"{{ button_erase_data }}\" class=\"btn btn-warning\" data-loading-text=\"{{ text_erasing }}\"><i class=\"fa fa-eraser\"></i></button>
        <button type=\"button\" id=\"button-erase-image\" data-toggle=\"tooltip\" title=\"{{ button_erase_image }}\" class=\"btn btn-danger\" data-loading-text=\"{{ text_erasing }}\"><i class=\"fa fa-eraser\"></i></button>
        <button type=\"button\" id=\"button-save\" data-toggle=\"tooltip\" title=\"{{ button_save }}\" class=\"btn btn-primary\" data-loading-text=\"{{ text_loading }}\"><i class=\"fa fa-save\"></i></button>
        <a href=\"{{ return }}\" data-toggle=\"tooltip\" title=\"{{ button_return }}\" class=\"btn btn-default\"><i class=\"fa fa-reply\"></i></a>
      </div>
      <h1>{{ heading_title }}</h1>
      <ul class=\"breadcrumb\">
        {% for breadcrumb in breadcrumbs %}
        <li><a href=\"{{ breadcrumb.href }}\">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ul>
    </div>
  </div>
  <div class=\"container-fluid\">
    <div class=\"row\">
      <div >
        <div class=\"card\">
          <div class=\"card-header\"><i class=\"fa-solid fa-filter\"></i> {{ text_filter }}</div>
          <div class=\"card-body\">
        <form action=\"\" method=\"post\" enctype=\"multipart/form-data\" id=\"form-modification\" class=\"form-horizontal\">
          <fieldset>
            <legend>{{ text_xml_code }}</legend>
            <div class=\"form-group\">
              <div class=\"col-sm-12\">
                <pre id=\"code\" style=\"width:100% !important; height:480px; position:relative; font-size:1.1em;\">{{ xml }}</pre>
                <input type=\"hidden\" name=\"modification_id\" value=\"{{ modification_id }}\" />
              </div>
            </div>
          </fieldset>
        </form>
      </div>
    </div>
  </div>
</div>

  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
  <script type=\"text/javascript\">
    var editor = ace.edit(\"code\");

    editor.setTheme(\"ace/theme/cobalt\");
    editor.setOptions({
        wrap: true,
        useSoftTabs: true,
    });
    editor.getSession().setMode(\"ace/mode/xml\");

  \$('#button-erase-theme').on('click', function() {
    \$('.alert').remove();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.erase_cache_theme&user_token={{ user_token }}',
      dataType: 'json',
      cache: false,
      beforeSend: function() {
        \$('#button-erase-theme').button('loading');
      },
      complete: function() {
        \$('#button-erase-theme').button('reset');
      },
      success: function(json) {
          if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
  \$('#button-erase-data').on('click', function() {
    \$('.alert').remove();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.erase_cache_data&user_token={{ user_token }}',
      dataType: 'json',
      cache: false,
      beforeSend: function() {
        \$('#button-erase-data').button('loading');
      },
      complete: function() {
        \$('#button-erase-data').button('reset');
      },
      success: function(json) {
          if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
  \$('#button-erase-image').on('click', function() {
    \$('.alert').remove();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.erase_cache_image&user_token={{ user_token }}',
      dataType: 'json',
      cache: false,
      beforeSend: function() {
        \$('#button-erase-image').button('loading');
      },
      complete: function() {
        \$('#button-erase-image').button('reset');
      },
      success: function(json) {
           if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
  \$('#button-save').on('click', function(){
    \$('.alert').remove();
    var id = \$('input[name=\"modification_id\"]').val();
    var xml_code = editor.getValue();
    \$.ajax({
      url: 'index.php?route=extension/ocmodeditor41x/modification/editor.save&user_token={{ user_token }}',
      type: 'post',
      dataType: 'json',
      data: { modification_id: id, xml: xml_code },
      cache: false,
      beforeSend: function() {
        \$('#button-save').button('loading');
      },
      complete: function() {
        \$('#button-save').button('reset');
      },
      success: function(json) {
        \$('.alert-dismissible').remove();

            if (json['error']) {
                \$('#alert').prepend('<div class=\"alert alert-danger alert-dismissible\"><i class=\"fa-solid fa-circle-exclamation\"></i> ' + json['error'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
            } else {
            \$('#alert').prepend('<div class=\"alert alert-success alert-dismissible\"><i class=\"fa-solid fa-check-circle\"></i> ' + json['success'] + ' <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\"></button></div>');
          
          if (id == 0) { location.href = 'index.php?route=marketplace/modification&user_token={{ user_token }}'; }
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
      }
    });
  });
//--></script> 
{{ footer }}", "extension/ocmodeditor41x/admin/view/template/modification/editor.twig", "/home/isatuzun/public_html/opencart.my-multiplanet.ch/extension/ocmodeditor41x/admin/view/template/modification/editor.twig");
    }
}
