<?php

/* pages.manage.tpl */
class __TwigTemplate_89b7534f8d7319c7ba180c5026aa74df extends Twig_Template
{
    public function display(array $context)
    {
        // line 1
        echo "<script type=\"text/javascript\">
\tShowLoadingIndicator();
\twindow.onload = function() {
\t\tHideLoadingIndicator();
\t};
</script>
<form name=\"frmPages\" id=\"frmPages\" method=\"post\" action=\"index.php?ToDo=deletePages\">
\t<div class=\"row\">
\t\t<div class=\"col-sm-12\">
\t\t\t<h4 class=\"page-title\">";
        // line 10
        echo getLang("ViewPages");
        echo "</h4>
\t\t\t<p>";
        // line 11
        echo twig_safe_filter((isset($context['PageIntro']) ? $context['PageIntro'] : null));
        echo "</p>
\t\t\t<div id=\"PagesStatus\">";
        // line 12
        echo twig_safe_filter((isset($context['Message']) ? $context['Message'] : null));
        echo "</div>
\t\t</div>
\t</div>

\t<div class=\"row\">
\t\t<div class=\"col-sm-12\">
\t\t\t<input type=\"button\" name=\"IndexAddButton\" value=\"";
        // line 18
        echo getLang("CreatePage");
        echo "\" id=\"IndexCreateButton\" class=\"btn btn-primary\" onclick=\"document.location.href='index.php?ToDo=createPage'\" /> 
\t\t\t<input type=\"button\" name=\"IndexDeleteButton\" value=\"";
        // line 19
        echo getLang("DeleteSelected");
        echo "\" id=\"IndexDeleteButton\" class=\"btn btn-danger\" onclick=\"ConfirmDeleteSelected()\" ";
        echo twig_safe_filter((isset($context['DisableDelete']) ? $context['DisableDelete'] : null));
        echo " />
\t\t</div>
\t</div>
\t<br />
\t<div class=\"panel panel-default\">
\t\t<div class=\"panel-body pn\">
\t\t\t<div class=\"table-responsive\">
\t\t\t\t<table class=\"GridPanel SortablePanel table table-striped\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:100%; margin: 0\">
\t\t\t\t\t<thead>
\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t<th width=\"1\" style=\"padding: 10px;\">
\t\t\t\t\t\t\t\t<input type=\"checkbox\" onclick=\"ToggleDeleteBoxes(this.checked)\" style=\"vertical-align: middle;\" />
\t\t\t\t\t\t\t</th>
\t\t\t\t\t\t\t<th>";
        // line 32
        echo getLang("PageTitle");
        echo "</th>
\t\t\t\t\t\t\t<th width=\"120\" align=\"center\">Tipo</th>
\t\t\t\t\t\t\t<th width=\"80\" align=\"center\">";
        // line 34
        echo getLang("Visible");
        echo "</th>
\t\t\t\t\t\t\t<th width=\"80\">";
        // line 35
        echo getLang("Action");
        echo "</th>
\t\t\t\t\t\t</tr>
\t\t\t\t\t</thead>
\t\t\t\t</table>
\t\t\t\t<ul class=\"SortableList\" id=\"PageList\">
\t\t\t\t\t";
        // line 40
        echo twig_safe_filter((isset($context['PageGrid']) ? $context['PageGrid'] : null));
        echo "
\t\t\t\t</ul>
\t\t\t</div>
\t\t</div>
\t</div>
\t<input type=\"hidden\" name=\"currentTab\" id=\"currentTab\" value=\"";
        // line 45
        echo twig_safe_filter((isset($context['CurrentTab']) ? $context['CurrentTab'] : null));
        echo "\" />
</form>

<script type=\"text/javascript\" src=\"../javascript/jquery/plugins/jquery.ui.nestedSortable.js?";
        // line 48
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\"></script>
<script type=\"text/javascript\">
\tfunction CheckSearchForm(){
\t\t\tvar filter = document.getElementById(\"filterCategory\");
\t\t\tvar query = document.getElementById(\"searchQuery\");

\t\t\tif(filter.value == \"\" && query.value == \"\")
\t\t\t{
\t\t\t\talert(\"";
        // line 56
        echo getLang("ChooseFilterOrEnterSearchTerm");
        echo "\");
\t\t\t\treturn false;
\t\t\t}

\t\t\treturn true;
\t\t}

\t\tfunction ConfirmDeleteSelected()
\t\t{
\t\t\tvar fp = document.getElementById(\"frmPages\").elements;
\t\t\tvar c = 0;

\t\t\tfor(i = 0; i < fp.length; i++)
\t\t\t{
\t\t\t\tif(fp[i].type == \"checkbox\" && fp[i].checked)
\t\t\t\t\tc++;
\t\t\t}

\t\t\tif(c > 0)
\t\t\t{
\t\t\t\tif(confirm(\"";
        // line 76
        echo getLang("ConfirmDeletePages");
        echo "\"))
\t\t\t\t\tdocument.getElementById(\"frmPages\").submit();
\t\t\t}
\t\t\telse
\t\t\t{
\t\t\t\talert(\"";
        // line 81
        echo getLang("ChoosePages");
        echo "\");
\t\t\t}
\t\t}

\t\tfunction ToggleDeleteBoxes(Status)
\t\t{
\t\t\tvar fp = document.getElementById(\"frmPages\").elements;

\t\t\tfor(i = 0; i < fp.length; i++)
\t\t\t\tfp[i].checked = Status;
\t\t}

\t\tfunction PreviewPage(PageId)
\t\t{
\t\t\tvar l = screen.availWidth / 2 - 300;
\t\t\tvar t = screen.availHeight / 2 - 300;
\t\t\tvar win = window.open('index.php?ToDo=previewPage&pageId='+PageId, 'pagePreview', 'width=600,height=600,left='+l+',top='+t+',scrollbars=1');
\t\t}

\t\tvar updatingSortables = false;
\t\tvar updateTimeout = null;
\t\tfunction CreateSortableList() {
\t\t\t\$('#PageList').nestedSortable({
\t\t\t\tdisableNesting: 'no-nest',
\t\t\t\tforcePlaceholderSize: true,
\t\t\t\thandle: '.sort-handle',
\t\t\t\titems: 'li',
\t\t\t\topacity: .8,
\t\t\t\ttabSize: 20,
\t\t\t\ttolerance: 'pointer',
\t\t\t\ttoleranceElement: '> table',
\t\t\t\tlistClass: 'SortableList',
\t\t\t\tplaceholder: 'SortableRowHelper',
\t\t\t\tupdate: function(event, ui) {
\t\t\t\t\tvar serialized = \$(this).sortable(\"serialize\");
\t\t\t\t\t\$.ajax({
\t\t\t\t\t\turl: 'remote.php?w=updatePageOrders',
\t\t\t\t\t\ttype: 'POST',
\t\t\t\t\t\tdataType: 'xml',
\t\t\t\t\t\tdata: serialized,
\t\t\t\t\t\tsuccess: function(response) {
\t\t\t\t\t\t\tvar status = \$('status', response).text();
\t\t\t\t\t\t\tvar message = \$('message', response).text();
\t\t\t\t\t\t\tif(status == 0) {
\t\t\t\t\t\t\t\tdisplay_error('PagesStatus', message);
\t\t\t\t\t\t\t}
\t\t\t\t\t\t\telse {
\t\t\t\t\t\t\t\tdisplay_success('PagesStatus', message);
\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\t}

\t\t\$(document).ready(function()
\t\t{
\t\t\tCreateSortableList();
\t\t});

\t\tfunction ShowTab(T)
\t\t{
\t\t\ti = 0;
\t\t\twhile (document.getElementById(\"tab\" + i) != null) {
\t\t\t\tdocument.getElementById(\"div\" + i).style.display = \"none\";
\t\t\t\tdocument.getElementById(\"tab\" + i).className = \"\";
\t\t\t\ti++;
\t\t\t}

\t\t\tdocument.getElementById(\"div\" + T).style.display = \"\";
\t\t\tdocument.getElementById(\"tab\" + T).className = \"active\";
\t\t\tdocument.getElementById(\"currentTab\").value = T;
\t\t}
\t</script>
\t";
    }

}
