<?php
/* Smarty version 3.1.29, created on 2016-07-14 20:11:11
  from "/var/www/user179/data/www/evolutionmu.ru/views/templates/default/admin/templates.tpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_5787e3cf520f93_42898653',
  'file_dependency' => 
  array (
    'c9c5b9c6c566da7d529f684ebb53a547c7c9e74d' => 
    array (
      0 => '/var/www/user179/data/www/evolutionmu.ru/views/templates/default/admin/templates.tpl',
      1 => 1468447032,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5787e3cf520f93_42898653 ($_smarty_tpl) {
echo '<script'; ?>
 type="text/javascript" src="/web/templates/default/admin/ckeditor/ckeditor.js"><?php echo '</script'; ?>
>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.css">
<?php echo '<script'; ?>
 type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"><?php echo '</script'; ?>
>

<div>
    <h2>Page Manager</h2>

    <form action="/admin/template" method="post">
        <table width="100%"><tr><td>
        <table id="template" class="display">
            <thead>
            <tr>
                <th>№</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable(1, null);
$_smarty_tpl->ext->_updateScope->updateScope($_smarty_tpl, 'i', 0);?>
            <?php
$_from = $_smarty_tpl->tpl_vars['Pages']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_page_0_saved_item = isset($_smarty_tpl->tpl_vars['page']) ? $_smarty_tpl->tpl_vars['page'] : false;
$_smarty_tpl->tpl_vars['page'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['page']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['page']->value) {
$_smarty_tpl->tpl_vars['page']->_loop = true;
$__foreach_page_0_saved_local_item = $_smarty_tpl->tpl_vars['page'];
?>
                <tr>
                    <td><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
                    <td><?php echo current(explode('.',$_smarty_tpl->tpl_vars['page']->value));?>
</td>
                    <td><button value="<?php echo $_smarty_tpl->tpl_vars['page']->value;?>
" name="update_page">Update</button></td>
                    <td><button value="<?php echo $_smarty_tpl->tpl_vars['page']->value;?>
" name="delete_page">Delete</button></td>
                </tr>
                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable($_smarty_tpl->tpl_vars['i']->value+1, null);
$_smarty_tpl->ext->_updateScope->updateScope($_smarty_tpl, 'i', 0);?>
            <?php
$_smarty_tpl->tpl_vars['page'] = $__foreach_page_0_saved_local_item;
}
if ($__foreach_page_0_saved_item) {
$_smarty_tpl->tpl_vars['page'] = $__foreach_page_0_saved_item;
}
?>
            </tbody>
        </table>
                </td></tr></table>
    </form>
    <h3>Add/Edit Page</h3>

    <div id="news">
        <form action="/admin/template" method="post">
            <table width="100%">
                <tr>
                    <th>Название</th>
                    <td><input type="text" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Title'];?>
" name="new_page_title"></td>
                </tr>

                <tr>
                    <th colspan="2">Описание</th>
                </tr>
                <tr>
                    <td colspan="2"><textarea placeholder="Content" name="page_content"><?php echo $_smarty_tpl->tpl_vars['Update']->value['Content'];?>
</textarea></td>
                </tr>
                <tr>
                    <td colspan="2"><button class="button_send"  name="page_btn" value="<?php echo $_smarty_tpl->tpl_vars['Update']->value['Title'];?>
">Отправить</button></td>
                </tr>
            </table>
        </form>
    </div>

</div>
<?php echo '<script'; ?>
 type="text/javascript">
    $(document).ready(function(){
        $('#template').DataTable();
    });
    CKEDITOR.replace("page_content");
    CKEDITOR.replace("news_desc");
<?php echo '</script'; ?>
>
<?php }
}
