<?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;
/* uredi_menu/index.html.twig */
class __TwigTemplate_cb6af6b3ead794396d2b7894fba0a4b1 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'javascriptcode' => [$this, 'block_javascriptcode'],
'breadcrumbs' => [$this, 'block_breadcrumbs'],
'content' => [$this, 'block_content'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "base.html.twig";
}
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", "uredi_menu/index.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "uredi_menu/index.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "uredi_menu/index.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_title($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(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
echo "Uredi vsebino parent = ";
echo twig_escape_filter($this->env, (isset($context["menu_parent_g"]) || array_key_exists("menu_parent_g", $context) ? $context["menu_parent_g"] : (function () { throw new RuntimeError('Variable "menu_parent_g" does not exist.', 3, $this->source); })()), "html", null, true);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 6
public function block_javascriptcode($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(), "block", "javascriptcode"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascriptcode"));
// line 7
echo " <script type=\"text/javascript\">
var datotekaInputUploader;
var datotekaMultipleInputUploader;
var datotekaAdditionalInputUploader;
var api;
var apiMultiple;
var apiAdditional;
var gUploadedImage;
function createUploaderImageMenu()
{
\$.ajax({
url:'";
// line 20
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("editmenu_getpreloadedimage");
echo "',
type: \"POST\",
dataType: \"json\",
async: true,
data:{ id: ";
// line 24
echo twig_escape_filter($this->env, (isset($context["menu_parent_g"]) || array_key_exists("menu_parent_g", $context) ? $context["menu_parent_g"] : (function () { throw new RuntimeError('Variable "menu_parent_g" does not exist.', 24, $this->source); })()), "html", null, true);
echo "},
success: function (return_data)
{
fileImage = \$('#datotekaInput').fileuploader(
{
limit: 1,
enableApi:true,
files: return_data,
onSelect: function(item)
{
if (!item.html.find('.fileuploader-action-start').length)
item.html.find('.fileuploader-action-remove').before('<a class=\"fileuploader-action fileuploader-action-start\" title=\"Upload\"><i></i></a>');
},
upload:
{
url: '";
// line 39
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("dodajmenuuploadimagecall");
echo "',
data: {
'menu_id': ";
// line 41
echo twig_escape_filter($this->env, (isset($context["menu_parent_g"]) || array_key_exists("menu_parent_g", $context) ? $context["menu_parent_g"] : (function () { throw new RuntimeError('Variable "menu_parent_g" does not exist.', 41, $this->source); })()), "html", null, true);
echo "
},
type: 'POST',
enctype: 'multipart/form-data',
start: true,
synchron: true,
beforeSend: function(item)
{
item.upload.data.custom_name = item.name;
},
onSuccess: function(result, item)
{
var data = {};
gUploadedImage = result[0].files[0].name;
try {
data = JSON.parse(result);
} catch (e) {
data.hasWarnings = true;
}
// get the new file name
if(data.isSuccess && data.files[0])
{
item.name = data.files[0].name;
item.html.find('.column-title div').animate({opacity: 0}, 400);
}
item.html.find('.fileuploader-action-remove').addClass('fileuploader-action-success');
setTimeout(function()
{
item.html.find('.column-title div').attr('title', result[0].files[0].name).text(result[0].files[0].name).animate({opacity: 1}, 400);
item.html.find('.progress-bar2').fadeOut(400);
},
400);
},
onError: function(item)
{
var progressBar = item.html.find('.progress-bar2');
// make HTML changes
if(progressBar.length > 0)
{
progressBar.find('span').html(0 + \"%\");
progressBar.find('.fileuploader-progressbar .bar').width(0 + \"%\");
item.html.find('.progress-bar2').fadeOut(400);
}
item.upload.status != 'cancelled' && item.html.find('.fileuploader-action-retry').length == 0 ? item.html.find('.column-actions').prepend(
'<a class=\"fileuploader-action fileuploader-action-retry\" title=\"Retry\"><i></i></a>'
) : null;
},
onProgress: function(data, item)
{
var progressBar = item.html.find('.progress-bar2');
// make HTML changes
if(progressBar.length > 0)
{
progressBar.show();
progressBar.find('span').html(data.percentage + \"%\");
progressBar.find('.fileuploader-progressbar .bar').width(data.percentage + \"%\");
}
},
onComplete: null,
},
onRemove: function(item)
{
// send POST request
\$.post('/api/ajax_remove_file.php', {
file: item.name
});
},
captions:
{
button: function(options) { return 'Izberi ' + (options.limit == 1 ? 'datoteko' : 'datoteke'); },
feedback: function(options) { return 'Izberi datoteko'; },
feedback2: function(options) { return 'Število izbranih datotek: ' + options.length; },
confirm: 'Potrdi',
cancel: 'Prekliči',
name: 'Ime',
type: 'Tip',
size: 'Velikost',
dimensions: 'Dimenzije',
duration: 'Čas trajanja',
crop: 'Razreži',
rotate: 'Rotiraj',
sort: 'Sortiraj',
download: 'Prenesi',
upload: 'Naloži',
remove: 'Odstrani',
drop: 'Povlecite sem datotetke, ki jih želite naložiti na strežnik.',
paste: '<div class=\"fileuploader-pending-loader\"></div> Datoteka se bo prilepila. Kliknite sem, če želite preklicati akcijo.',
removeConfirmation: 'Ste prepričani, da želite izbrisati datoteko?',
errors: {
filesLimit: 'Število dovoljenih datotek: \${limit}.',
filesType: 'Dovoljeni tipi datotek: \${extensions}.',
fileSize: '\${name} je predolga! Največja dovoljena velikost datoteke je \${fileMaxSize} MB.',
filesSizeAll: 'Datoteke so predolge! Največja dovoljena velikost datotek je \${maxSize} MB.',
fileName: 'Datoteka z imenom \${name} je že izbrana.',
folderUpload: 'Prenos map ni dovoljen.'
}
}
});
apiContentImage = \$.fileuploader.getInstance(fileImage);
}});
}
function fillData()
{
gUploadedImage = '";
// line 154
echo twig_escape_filter($this->env, (isset($context["menu_image"]) || array_key_exists("menu_image", $context) ? $context["menu_image"] : (function () { throw new RuntimeError('Variable "menu_image" does not exist.', 154, $this->source); })()), "html", null, true);
echo "';
createUploaderImageMenu();
//createUploaderMultipleImage();
//clearFields();
}
\$( document ).ready(function()
{
if ('";
// line 165
echo twig_escape_filter($this->env, (isset($context["menu_lang_g"]) || array_key_exists("menu_lang_g", $context) ? $context["menu_lang_g"] : (function () { throw new RuntimeError('Variable "menu_lang_g" does not exist.', 165, $this->source); })()), "html", null, true);
echo "' == 'si')
{
\$(\"#defaultFlag\").attr(\"src\",\"";
// line 167
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/flags/Slovenia.png"), "html", null, true);
echo "\");
}
else if ('";
// line 169
echo twig_escape_filter($this->env, (isset($context["menu_lang_g"]) || array_key_exists("menu_lang_g", $context) ? $context["menu_lang_g"] : (function () { throw new RuntimeError('Variable "menu_lang_g" does not exist.', 169, $this->source); })()), "html", null, true);
echo "' =='en')
{
\$(\"#defaultFlag\").attr(\"src\",\"";
// line 171
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/flags/United-Kingdom.png"), "html", null, true);
echo "\");
}
else if ('";
// line 173
echo twig_escape_filter($this->env, (isset($context["menu_lang_g"]) || array_key_exists("menu_lang_g", $context) ? $context["menu_lang_g"] : (function () { throw new RuntimeError('Variable "menu_lang_g" does not exist.', 173, $this->source); })()), "html", null, true);
echo "' =='it')
{
\$(\"#defaultFlag\").attr(\"src\",\"";
// line 175
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("img/flags/Italy.png"), "html", null, true);
echo "\");
}
tinymce.init({
selector: 'textarea',
height:600,
width:1000,
plugins: 'fullpage advlist autolink lists link image charmap print preview hr anchor pagebreak moxiemanager code table',
toolbar: 'fullpage code table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol undo redo | insert | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar_mode: 'floating',
extended_valid_elements : \"script[src|async|defer|type|charset]\",
convert_urls: false,
entity_encoding:'raw',
setup: function (editor) {
editor.on('init', function () {
var content ='";
// line 196
echo twig_escape_filter($this->env, (isset($context["menu_content"]) || array_key_exists("menu_content", $context) ? $context["menu_content"] : (function () { throw new RuntimeError('Variable "menu_content" does not exist.', 196, $this->source); })()), "html", null, true);
echo "';
//editor.setContent(content);
//editor.setContent('<p><b>To je bla</b></p>');
var Title = \$('<textarea />').html(content).text();
var TitleTrimmed =Title.substring(1, Title.length-1);
editor.setContent(TitleTrimmed.trim());
});
}
});
fillData();
//tinymce.get('textarea').focus();
tinymce.activeEditor.setContent(\"Dodajte novo vsebino\");
//napolnim vnosna polja za urejanje menija
\$('#menu_title').val('";
// line 217
echo twig_escape_filter($this->env, (isset($context["menu_title"]) || array_key_exists("menu_title", $context) ? $context["menu_title"] : (function () { throw new RuntimeError('Variable "menu_title" does not exist.', 217, $this->source); })()), "html", null, true);
echo "');
if('";
// line 220
echo twig_escape_filter($this->env, (isset($context["menu_visible"]) || array_key_exists("menu_visible", $context) ? $context["menu_visible"] : (function () { throw new RuntimeError('Variable "menu_visible" does not exist.', 220, $this->source); })()), "html", null, true);
echo "' == 0)
{
\$('#menu_visible').prop('checked', false);
}
else
{
\$('#menu_visible').prop('checked', true);
}
//gumb zapriOkno CLICK!
\$(\"#zapriOkno\").click(function(){
location.href = '/menus';
});
//gumb shrani CLICK!
\$(\"#shranimenu\").click(function(){
console.log(\"TEST\");
//var myContent = tinymce.get(\"textarea\").getContent();
var myContent = tinymce.activeEditor.getContent();
console.log(myContent);
//preverjamo ali je spremenljivka definirana
if (typeof gUploadedImage !== 'undefined') {
// the variable is defined
}
else
{
gUploadedImage = \"\";
}
//ajax call za uredi vsebino!
\$.ajax({
url:'";
// line 255
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("uredimenucall");
echo "',
type: \"POST\",
dataType: \"json\",
async: true,
data: {
'menu_title' : \$('#menu_title').val(),
'menu_content': myContent,
'menu_parent': ";
// line 262
echo twig_escape_filter($this->env, (isset($context["menu_parent_g"]) || array_key_exists("menu_parent_g", $context) ? $context["menu_parent_g"] : (function () { throw new RuntimeError('Variable "menu_parent_g" does not exist.', 262, $this->source); })()), "html", null, true);
echo ",
'menu_lang': '";
// line 263
echo twig_escape_filter($this->env, (isset($context["menu_lang_g"]) || array_key_exists("menu_lang_g", $context) ? $context["menu_lang_g"] : (function () { throw new RuntimeError('Variable "menu_lang_g" does not exist.', 263, $this->source); })()), "html", null, true);
echo "',
'menu_top': \$('#menu_top').is(':checked'),
'menu_footer': \$('#menu_footer').is(':checked'),
'menu_visible': \$('#menu_visible').is(':checked'),
'menu_image': gUploadedImage
},
success: function (return_data)
{
\t\t\t\t\t\tif (return_data.data == \"ok\")
{
\t\t\t\t\t\t\t
\t\t\t\t\t\t}
\t\t\t\t\t\telse
\t\t\t\t\t\t{
\t\t\t\t\t\t\t\$('#opozoriloSplosno').attr('class','alert alert-danger');
\t\t\t\t\t\t\t\$('#opozoriloSplosno').text('Brisanje LVK ni mogoče, ker imate nezaključene postavke.');
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t}
\t\t\t\t\t\t\$('#opozoriloSplosno').show();
\t\t\t\t\t\t\$(\"html, body\").animate({ scrollTop: 0 }, \"slow\");
},
error: function (xhr, ajaxOptions, thrownError)
{
\t\t\t\t\t\tconsole.log(thrownError);
}
});
location.href = '/menus';
//END ajax call za shrani vsebino
});
//END gumb shrani vsebino CLICK
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 302
public function block_breadcrumbs($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(), "block", "breadcrumbs"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "breadcrumbs"));
// line 303
echo " <li class=\"breadcrumb-item\">Domov</li>
<!--<li class=\"breadcrumb-item\"><a href=\"#\">Šifranti</a></li>-->
<li class=\"breadcrumb-item active\">Vsebina</li>
<li style=\"float: right;\">prijavljen: ";
// line 306
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 306, $this->source); })()), "user", [], "any", false, false, false, 306), "name", [], "any", false, false, false, 306), "html", null, true);
echo "</li>
<!-- Breadcrumb Menu-->
<li class=\"breadcrumb-menu d-md-down-none\">
<div class=\"btn-group\" role=\"group\" aria-label=\"Button group with nested dropdown\"></div>
</li>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 314
public function block_content($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(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 315
echo "<div class=\"card\">
\t\t<div class=\"card-header\">
\t\t\t<i class=\"fa fa-edit\"></i>
\t\t\t<strong>Urejanje menuja</strong>
\t\t\t<span id=\"shranjujem\" style=\"padding-left: 20px;color: #20a8d8;display:none;\">... shranjujem ... </span>
<div class=\"card-actions\">
</div>
\t\t</div>
\t\t<div class=\"card-body\">
<div id=\"opozoriloSplosno\" class=\"alert alert-danger\" role=\"alert\" style=\"display:none;\">
-
</div>
<ul class=\"nav nav-tabs\" role=\"tablist\">
<li class=\"nav-item\">
<a class=\"nav-link active\" data-toggle=\"tab\" href=\"#vsebina\" role=\"tab\" aria-controls=\"home\"><i class=\"icon-book-open\"></i> Vsebina</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" data-toggle=\"tab\" href=\"#dodatnefotografije\" role=\"tab\" aria-controls=\"profile\"><i class=\"icon-picture\"></i> Dodatne fotografije</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" data-toggle=\"tab\" href=\"#dodatnedatoteke\" role=\"tab\" aria-controls=\"messages\"><i class=\"icon-paper-clip\"></i> Dodatne datoteke</a>
</li>
</ul>
<div class=\"tab-content\">
<div class=\"tab-pane active\" id=\"vsebina\" role=\"tabpanel\">
<form id=\"vsebinaForma\" enctype=\"multipart/form-data\">
<div class=\"form-group\">
<label for=\"naslov\">Naziv menija</label>
<input type=\"text\" class=\"form-control\" id=\"menu_title\" placeholder=\"Vnesite naziv menija\" name=\"menu_title\">
</div>
<div class=\"form-group\">
<label for=\"besedilo\">Besedilo menija</label>
<textarea id=\"menu_content\" name=\"menu_content\">
</textarea>
</div>
<div class=\"form-group\">
<div class=\"file-loading\">
<label for=\"datotekaInput\">Slika menija</label>
<input id=\"datotekaInput\" type=\"file\" class=\"file\" data-overwrite-initial=\"false\" name=\"datotekaInput\" multiple=\"true\" data-fileuploader-files=''>
</div>
</div>
<hr>
<div class=\"form-group\">
<label for=\"vidna\">Ali naj bo meni viden?</label><br>
<label class=\"switch switch-text switch-pill switch-primary\">
<input type=\"checkbox\" class=\"switch-input\" checked=\"\" name=\"menu_visible\" id=\"menu_visible\">
<span class=\"switch-label\" data-on=\"DA\" data-off=\"NE\"></span>
<span class=\"switch-handle\"></span>
</label>
</div>
<div class=\"form-group\">
<label for=\"vidna_menu\">Ali naj bo gradnik viden v menuju?</label><br>
<label class=\"switch switch-text switch-pill switch-primary\">
<input type=\"checkbox\" class=\"switch-input\" checked=\"\" name=\"menu_top\" id=\"menu_top\">
<span class=\"switch-label\" data-on=\"DA\" data-off=\"NE\"></span>
<span class=\"switch-handle\"></span>
</label>
</div>
<div class=\"form-group\">
<label for=\"vidna_footer\">Ali naj bo gradnik vidna v nogi?</label><br>
<label class=\"switch switch-text switch-pill switch-primary\">
<input type=\"checkbox\" class=\"switch-input\" checked=\"\" name=\"menu_footer\" id=\"menu_footer\">
<span class=\"switch-label\" data-on=\"DA\" data-off=\"NE\"></span>
<span class=\"switch-handle\"></span>
</label>
</div>
</form>
</div>
<div class=\"tab-pane\" id=\"dodatnefotografije\" role=\"tabpanel\">
<form id=\"fotografijeForma\" enctype=\"multipart/form-data\">
<div class=\"form-group\">
<div class=\"file-loading\">
<label for=\"datotekaMultipleInput\">Dodatne fotografije</label>
<input class=\"gallery_media\" id=\"datotekaMultipleInput\" type=\"file\" class=\"file\" name=\"datotekaMultipleInput[]\" multiple=\"true\" >
</div>
</div>
</form>
</div>
<div class=\"tab-pane\" id=\"dodatnedatoteke\" role=\"tabpanel\">
<form id=\"datotekeForma\" enctype=\"multipart/form-data\">
<div class=\"form-group\">
<div class=\"file-loading\">
<label for=\"datotekaAdditionalInput\">Dodatne datoteke</label>
<input id=\"datotekaAdditionalInput\" type=\"file\" class=\"file\" data-overwrite-initial=\"false\" name=\"datotekaAdditionalInput[]\" multiple=\"true\">
</div>
</div>
</form>
</div>
</div>
</div>
<div class=\"card-footer\">
<button type=\"button\" class=\"btn btn-primary\" id=\"shranimenu\">Shrani menu</button>
<button type=\"button\" class=\"btn btn-secondary\" id=\"zapriOkno\">Prekliči</button>
</div>
\t</div><!--card-->
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "uredi_menu/index.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 484 => 315, 474 => 314, 457 => 306, 452 => 303, 442 => 302, 397 => 263, 393 => 262, 383 => 255, 345 => 220, 339 => 217, 315 => 196, 291 => 175, 286 => 173, 281 => 171, 276 => 169, 271 => 167, 266 => 165, 252 => 154, 136 => 41, 131 => 39, 113 => 24, 106 => 20, 91 => 7, 81 => 6, 61 => 3, 38 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'base.html.twig' %}
{% block title %}Uredi vsebino parent = {{menu_parent_g}}{% endblock %}
{% block javascriptcode %}
<script type=\"text/javascript\">
var datotekaInputUploader;
var datotekaMultipleInputUploader;
var datotekaAdditionalInputUploader;
var api;
var apiMultiple;
var apiAdditional;
var gUploadedImage;
function createUploaderImageMenu()
{
\$.ajax({
url:'{{ path('editmenu_getpreloadedimage') }}',
type: \"POST\",
dataType: \"json\",
async: true,
data:{ id: {{ menu_parent_g }}},
success: function (return_data)
{
fileImage = \$('#datotekaInput').fileuploader(
{
limit: 1,
enableApi:true,
files: return_data,
onSelect: function(item)
{
if (!item.html.find('.fileuploader-action-start').length)
item.html.find('.fileuploader-action-remove').before('<a class=\"fileuploader-action fileuploader-action-start\" title=\"Upload\"><i></i></a>');
},
upload:
{
url: '{{ path('dodajmenuuploadimagecall') }}',
data: {
'menu_id': {{ menu_parent_g }}
},
type: 'POST',
enctype: 'multipart/form-data',
start: true,
synchron: true,
beforeSend: function(item)
{
item.upload.data.custom_name = item.name;
},
onSuccess: function(result, item)
{
var data = {};
gUploadedImage = result[0].files[0].name;
try {
data = JSON.parse(result);
} catch (e) {
data.hasWarnings = true;
}
// get the new file name
if(data.isSuccess && data.files[0])
{
item.name = data.files[0].name;
item.html.find('.column-title div').animate({opacity: 0}, 400);
}
item.html.find('.fileuploader-action-remove').addClass('fileuploader-action-success');
setTimeout(function()
{
item.html.find('.column-title div').attr('title', result[0].files[0].name).text(result[0].files[0].name).animate({opacity: 1}, 400);
item.html.find('.progress-bar2').fadeOut(400);
},
400);
},
onError: function(item)
{
var progressBar = item.html.find('.progress-bar2');
// make HTML changes
if(progressBar.length > 0)
{
progressBar.find('span').html(0 + \"%\");
progressBar.find('.fileuploader-progressbar .bar').width(0 + \"%\");
item.html.find('.progress-bar2').fadeOut(400);
}
item.upload.status != 'cancelled' && item.html.find('.fileuploader-action-retry').length == 0 ? item.html.find('.column-actions').prepend(
'<a class=\"fileuploader-action fileuploader-action-retry\" title=\"Retry\"><i></i></a>'
) : null;
},
onProgress: function(data, item)
{
var progressBar = item.html.find('.progress-bar2');
// make HTML changes
if(progressBar.length > 0)
{
progressBar.show();
progressBar.find('span').html(data.percentage + \"%\");
progressBar.find('.fileuploader-progressbar .bar').width(data.percentage + \"%\");
}
},
onComplete: null,
},
onRemove: function(item)
{
// send POST request
\$.post('/api/ajax_remove_file.php', {
file: item.name
});
},
captions:
{
button: function(options) { return 'Izberi ' + (options.limit == 1 ? 'datoteko' : 'datoteke'); },
feedback: function(options) { return 'Izberi datoteko'; },
feedback2: function(options) { return 'Število izbranih datotek: ' + options.length; },
confirm: 'Potrdi',
cancel: 'Prekliči',
name: 'Ime',
type: 'Tip',
size: 'Velikost',
dimensions: 'Dimenzije',
duration: 'Čas trajanja',
crop: 'Razreži',
rotate: 'Rotiraj',
sort: 'Sortiraj',
download: 'Prenesi',
upload: 'Naloži',
remove: 'Odstrani',
drop: 'Povlecite sem datotetke, ki jih želite naložiti na strežnik.',
paste: '<div class=\"fileuploader-pending-loader\"></div> Datoteka se bo prilepila. Kliknite sem, če želite preklicati akcijo.',
removeConfirmation: 'Ste prepričani, da želite izbrisati datoteko?',
errors: {
filesLimit: 'Število dovoljenih datotek: \${limit}.',
filesType: 'Dovoljeni tipi datotek: \${extensions}.',
fileSize: '\${name} je predolga! Največja dovoljena velikost datoteke je \${fileMaxSize} MB.',
filesSizeAll: 'Datoteke so predolge! Največja dovoljena velikost datotek je \${maxSize} MB.',
fileName: 'Datoteka z imenom \${name} je že izbrana.',
folderUpload: 'Prenos map ni dovoljen.'
}
}
});
apiContentImage = \$.fileuploader.getInstance(fileImage);
}});
}
function fillData()
{
gUploadedImage = '{{ menu_image }}';
createUploaderImageMenu();
//createUploaderMultipleImage();
//clearFields();
}
\$( document ).ready(function()
{
if ('{{menu_lang_g}}' == 'si')
{
\$(\"#defaultFlag\").attr(\"src\",\"{{ asset('img/flags/Slovenia.png')}}\");
}
else if ('{{menu_lang_g}}' =='en')
{
\$(\"#defaultFlag\").attr(\"src\",\"{{ asset('img/flags/United-Kingdom.png')}}\");
}
else if ('{{menu_lang_g}}' =='it')
{
\$(\"#defaultFlag\").attr(\"src\",\"{{ asset('img/flags/Italy.png')}}\");
}
tinymce.init({
selector: 'textarea',
height:600,
width:1000,
plugins: 'fullpage advlist autolink lists link image charmap print preview hr anchor pagebreak moxiemanager code table',
toolbar: 'fullpage code table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol undo redo | insert | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar_mode: 'floating',
extended_valid_elements : \"script[src|async|defer|type|charset]\",
convert_urls: false,
entity_encoding:'raw',
setup: function (editor) {
editor.on('init', function () {
var content ='{{menu_content}}';
//editor.setContent(content);
//editor.setContent('<p><b>To je bla</b></p>');
var Title = \$('<textarea />').html(content).text();
var TitleTrimmed =Title.substring(1, Title.length-1);
editor.setContent(TitleTrimmed.trim());
});
}
});
fillData();
//tinymce.get('textarea').focus();
tinymce.activeEditor.setContent(\"Dodajte novo vsebino\");
//napolnim vnosna polja za urejanje menija
\$('#menu_title').val('{{menu_title}}');
if('{{menu_visible}}' == 0)
{
\$('#menu_visible').prop('checked', false);
}
else
{
\$('#menu_visible').prop('checked', true);
}
//gumb zapriOkno CLICK!
\$(\"#zapriOkno\").click(function(){
location.href = '/menus';
});
//gumb shrani CLICK!
\$(\"#shranimenu\").click(function(){
console.log(\"TEST\");
//var myContent = tinymce.get(\"textarea\").getContent();
var myContent = tinymce.activeEditor.getContent();
console.log(myContent);
//preverjamo ali je spremenljivka definirana
if (typeof gUploadedImage !== 'undefined') {
// the variable is defined
}
else
{
gUploadedImage = \"\";
}
//ajax call za uredi vsebino!
\$.ajax({
url:'{{ path('uredimenucall') }}',
type: \"POST\",
dataType: \"json\",
async: true,
data: {
'menu_title' : \$('#menu_title').val(),
'menu_content': myContent,
'menu_parent': {{menu_parent_g}},
'menu_lang': '{{menu_lang_g}}',
'menu_top': \$('#menu_top').is(':checked'),
'menu_footer': \$('#menu_footer').is(':checked'),
'menu_visible': \$('#menu_visible').is(':checked'),
'menu_image': gUploadedImage
},
success: function (return_data)
{
\t\t\t\t\t\tif (return_data.data == \"ok\")
{
\t\t\t\t\t\t\t
\t\t\t\t\t\t}
\t\t\t\t\t\telse
\t\t\t\t\t\t{
\t\t\t\t\t\t\t\$('#opozoriloSplosno').attr('class','alert alert-danger');
\t\t\t\t\t\t\t\$('#opozoriloSplosno').text('Brisanje LVK ni mogoče, ker imate nezaključene postavke.');
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t}
\t\t\t\t\t\t\$('#opozoriloSplosno').show();
\t\t\t\t\t\t\$(\"html, body\").animate({ scrollTop: 0 }, \"slow\");
},
error: function (xhr, ajaxOptions, thrownError)
{
\t\t\t\t\t\tconsole.log(thrownError);
}
});
location.href = '/menus';
//END ajax call za shrani vsebino
});
//END gumb shrani vsebino CLICK
});
</script>
{% endblock %}
{% block breadcrumbs %}
<li class=\"breadcrumb-item\">Domov</li>
<!--<li class=\"breadcrumb-item\"><a href=\"#\">Šifranti</a></li>-->
<li class=\"breadcrumb-item active\">Vsebina</li>
<li style=\"float: right;\">prijavljen: {{ app.user.name }}</li>
<!-- Breadcrumb Menu-->
<li class=\"breadcrumb-menu d-md-down-none\">
<div class=\"btn-group\" role=\"group\" aria-label=\"Button group with nested dropdown\"></div>
</li>
{% endblock %}
{% block content %}
<div class=\"card\">
\t\t<div class=\"card-header\">
\t\t\t<i class=\"fa fa-edit\"></i>
\t\t\t<strong>Urejanje menuja</strong>
\t\t\t<span id=\"shranjujem\" style=\"padding-left: 20px;color: #20a8d8;display:none;\">... shranjujem ... </span>
<div class=\"card-actions\">
</div>
\t\t</div>
\t\t<div class=\"card-body\">
<div id=\"opozoriloSplosno\" class=\"alert alert-danger\" role=\"alert\" style=\"display:none;\">
-
</div>
<ul class=\"nav nav-tabs\" role=\"tablist\">
<li class=\"nav-item\">
<a class=\"nav-link active\" data-toggle=\"tab\" href=\"#vsebina\" role=\"tab\" aria-controls=\"home\"><i class=\"icon-book-open\"></i> Vsebina</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" data-toggle=\"tab\" href=\"#dodatnefotografije\" role=\"tab\" aria-controls=\"profile\"><i class=\"icon-picture\"></i> Dodatne fotografije</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" data-toggle=\"tab\" href=\"#dodatnedatoteke\" role=\"tab\" aria-controls=\"messages\"><i class=\"icon-paper-clip\"></i> Dodatne datoteke</a>
</li>
</ul>
<div class=\"tab-content\">
<div class=\"tab-pane active\" id=\"vsebina\" role=\"tabpanel\">
<form id=\"vsebinaForma\" enctype=\"multipart/form-data\">
<div class=\"form-group\">
<label for=\"naslov\">Naziv menija</label>
<input type=\"text\" class=\"form-control\" id=\"menu_title\" placeholder=\"Vnesite naziv menija\" name=\"menu_title\">
</div>
<div class=\"form-group\">
<label for=\"besedilo\">Besedilo menija</label>
<textarea id=\"menu_content\" name=\"menu_content\">
</textarea>
</div>
<div class=\"form-group\">
<div class=\"file-loading\">
<label for=\"datotekaInput\">Slika menija</label>
<input id=\"datotekaInput\" type=\"file\" class=\"file\" data-overwrite-initial=\"false\" name=\"datotekaInput\" multiple=\"true\" data-fileuploader-files=''>
</div>
</div>
<hr>
<div class=\"form-group\">
<label for=\"vidna\">Ali naj bo meni viden?</label><br>
<label class=\"switch switch-text switch-pill switch-primary\">
<input type=\"checkbox\" class=\"switch-input\" checked=\"\" name=\"menu_visible\" id=\"menu_visible\">
<span class=\"switch-label\" data-on=\"DA\" data-off=\"NE\"></span>
<span class=\"switch-handle\"></span>
</label>
</div>
<div class=\"form-group\">
<label for=\"vidna_menu\">Ali naj bo gradnik viden v menuju?</label><br>
<label class=\"switch switch-text switch-pill switch-primary\">
<input type=\"checkbox\" class=\"switch-input\" checked=\"\" name=\"menu_top\" id=\"menu_top\">
<span class=\"switch-label\" data-on=\"DA\" data-off=\"NE\"></span>
<span class=\"switch-handle\"></span>
</label>
</div>
<div class=\"form-group\">
<label for=\"vidna_footer\">Ali naj bo gradnik vidna v nogi?</label><br>
<label class=\"switch switch-text switch-pill switch-primary\">
<input type=\"checkbox\" class=\"switch-input\" checked=\"\" name=\"menu_footer\" id=\"menu_footer\">
<span class=\"switch-label\" data-on=\"DA\" data-off=\"NE\"></span>
<span class=\"switch-handle\"></span>
</label>
</div>
</form>
</div>
<div class=\"tab-pane\" id=\"dodatnefotografije\" role=\"tabpanel\">
<form id=\"fotografijeForma\" enctype=\"multipart/form-data\">
<div class=\"form-group\">
<div class=\"file-loading\">
<label for=\"datotekaMultipleInput\">Dodatne fotografije</label>
<input class=\"gallery_media\" id=\"datotekaMultipleInput\" type=\"file\" class=\"file\" name=\"datotekaMultipleInput[]\" multiple=\"true\" >
</div>
</div>
</form>
</div>
<div class=\"tab-pane\" id=\"dodatnedatoteke\" role=\"tabpanel\">
<form id=\"datotekeForma\" enctype=\"multipart/form-data\">
<div class=\"form-group\">
<div class=\"file-loading\">
<label for=\"datotekaAdditionalInput\">Dodatne datoteke</label>
<input id=\"datotekaAdditionalInput\" type=\"file\" class=\"file\" data-overwrite-initial=\"false\" name=\"datotekaAdditionalInput[]\" multiple=\"true\">
</div>
</div>
</form>
</div>
</div>
</div>
<div class=\"card-footer\">
<button type=\"button\" class=\"btn btn-primary\" id=\"shranimenu\">Shrani menu</button>
<button type=\"button\" class=\"btn btn-secondary\" id=\"zapriOkno\">Prekliči</button>
</div>
\t</div><!--card-->
{% endblock %}
", "uredi_menu/index.html.twig", "/var/www/nota/templates/uredi_menu/index.html.twig");
}
}