<?php
/* Smarty version 4.5.3, created on 2025-03-23 11:54:35
  from '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/page.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_67dfcc4b54fa09_70965093',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '87cb69845a647c6fe2ab901bae170d39360459f9' => 
    array (
      0 => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/page.tpl',
      1 => 1742720074,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:components/annotation-body.tpl' => 1,
    'file:components/images.tpl' => 1,
    'file:components/files.tpl' => 1,
    'file:components/related.tpl' => 1,
    'file:components/properties.tpl' => 1,
    'file:components/meta.tpl' => 1,
  ),
),false)) {
function content_67dfcc4b54fa09_70965093 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions($_smarty_tpl, array (
  'section_select' => 
  array (
    'compiled_filepath' => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/compiled/87cb69845a647c6fe2ab901bae170d39360459f9_0.file.page.tpl.php',
    'uid' => '87cb69845a647c6fe2ab901bae170d39360459f9',
    'call_name' => 'smarty_template_function_section_select_134219554167dfcc4b4f6b57_87854501',
  ),
));
if ($_smarty_tpl->tpl_vars['page']->value->id) {
$_smarty_tpl->_assignInScope('meta_title', $_smarty_tpl->tpl_vars['page']->value->name ,false ,8);
} else {
$_smarty_tpl->_assignInScope('meta_title', 'Новая страница' ,false ,8);
}?>

<?php $_smarty_tpl->_assignInScope('tabs', "tabs" ,false ,8);?>

<div class="container-fluid">

        <div class="nk-block-head nk-block-head-sm">
        <div class="nk-block-between">

                        <div class="nk-block-head-content">
                <h3 class="nk-block-title page-title">
                    <?php if ($_smarty_tpl->tpl_vars['page']->value->id) {?>
                        Редактирование страницы: <?php echo $_smarty_tpl->tpl_vars['page']->value->name;?>

                    <?php } else { ?>
                        Новая страница
                    <?php }?>
                </h3>
                <div class="nk-block-des text-soft">
                    <p>Управление страницами сайта.</p>
                </div>
            </div>

                        <div class="nk-block-head-content">
                <div class="toggle-wrap nk-block-tools-toggle">

                                        <a href="#" class="btn btn-icon btn-trigger toggle-expand mr-n1" data-target="pageMenu">
                        <em class="icon ti ti-menu"></em>
                    </a>

                                        <div class="toggle-expand-content" data-content="pageMenu">
                        <ul class="nk-block-tools g-3">

                                                        <?php if ($_GET['return']) {?>
                            <li>
                                <a href="<?php echo $_GET['return'];?>
" class="btn btn-white btn-outline-light">
                                    <em class="icon ti ti-arrow-back-up"></em>
                                    <span>Вернуться</span>
                                </a>
                            </li>
                            <?php }?>

                                                        <?php if ($_smarty_tpl->tpl_vars['page']->value->id) {?>
                            <li>
                                <a href="<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0], array( array('module'=>'PageAdmin','return'=>$_SERVER['REQUEST_URI']),$_smarty_tpl ) );?>
" class="btn btn-light btn-icon btn-outline-light" data-toggle="tooltip" data-placement="top" title="Создать страницу">
                                    <em class="icon ti ti-plus"></em>
                                </a>
                            </li>

                                                        <li>
                                <a href="../<?php echo $_smarty_tpl->tpl_vars['page']->value->url;?>
" target="_blank" class="btn btn-light btn-icon btn-outline-light" data-toggle="tooltip" data-placement="top" title="Открыть на сайте">
                                    <em class="icon ti ti-external-link"></em>
                                </a>
                            </li>
                            <?php }?>

                        </ul>
                    </div>
                </div>
            </div>

        </div>
    </div>

        <?php if ($_GET['message_success']) {?>
    <div class="pb-2">
        <div class="alert alert-fill alert-success alert-icon">
            <em class="icon ti ti-circle-check"></em>
            <?php if ($_GET['message_success'] == 'added') {?>Страница создана<?php } elseif ($_GET['message_success'] == 'updated') {?>Страница обновлена<?php } else {
echo $_GET['message_success'];
}?>.
        </div>
    </div>
    <?php }?>

        <?php if ($_smarty_tpl->tpl_vars['message_error']->value) {?>
    <div class="pb-2">
        <div class="alert alert-fill alert-danger alert-icon">
            <em class="icon ti ti-circle-x"></em>
            <?php if ($_smarty_tpl->tpl_vars['message_error']->value == 'url_exists') {?>Страница с таким адресом уже существует<?php } elseif ($_smarty_tpl->tpl_vars['message_error']->value == 'name_empty') {?>У страницы должно быть имя<?php } elseif ($_smarty_tpl->tpl_vars['message_error']->value == 'url_empty') {?>URL не может быть пустым<?php }?>.
        </div>
    </div>
    <?php }?>

        <form method="post" enctype="multipart/form-data">
        <input name="id" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['page']->value->id;?>
"/>

        <div class="row">

                        <div class="col-lg-8 mb-3 mb-lg-0">

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <div class="nk-block">
                            	<div class="nk-block-head">
                            		<h5 class="title">Основная информация</h5>
                            		<p>Основные данные страницы.</p>
                            	</div>
                                <div class="row gy-4">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="page_name">Краткое название страницы</label>
                                            <div class="form-control-wrap">
                                                <input type="text" class="form-control" id="page_name" name="name" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['page']->value->name, ENT_QUOTES, 'UTF-8', true);?>
" required>
                                            </div>
                                            <span class="form-note">К примеру "Услуги".</span>
                                        </div>
                                    </div>

                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="page_header">Заголовок H1</label>
                                            <div class="form-control-wrap">
                                                <input type="text" class="form-control" id="page_header" name="header" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['page']->value->header, ENT_QUOTES, 'UTF-8', true);?>
">
                                            </div>
                                            <span class="form-note">К примеру "Список доп. услуг по монтажу пластиковых окон".</span>
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="form-label" for="parent_id">Родительская страница</label>
                                            <div class="form-control-wrap">
                                                <select name="parent_id" id="parent_id" class="form-select form-control form-control-lg" data-search="on">
                                                    <option value='0' data-template="page.tpl">Корневая страница</option>
                                                    
                                                    <?php $_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction($_smarty_tpl, 'section_select', array('pages'=>$_smarty_tpl->tpl_vars['pages']->value,'level'=>0), true);?>

                                                </select>
                                            </div>
                                            <span class="form-note">Страница может быть корневой или иметь родителя.</span>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="form-label" for="page_template">Шаблон</label>
                                            <div class="form-control-wrap">
                                                <select name="template" id="page_template" class="form-select form-control form-control-lg" data-search="on">
                                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['templates']->value, 'name');
$_smarty_tpl->tpl_vars['name']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['name']->value) {
$_smarty_tpl->tpl_vars['name']->do_else = false;
?>
                                                    <option value='<?php echo $_smarty_tpl->tpl_vars['name']->value;?>
' <?php if ($_smarty_tpl->tpl_vars['page']->value->template == $_smarty_tpl->tpl_vars['name']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['name']->value;?>
</option>
                                                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                                </select>
                                            </div>
                                            <span class="form-note">Шаблон для вывода данных. <?php if ($_smarty_tpl->tpl_vars['page']->value->template) {?><b><a target="_blank" href="<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0], array( array('module'=>'DesignAdmin','type'=>'html','file'=>$_smarty_tpl->tpl_vars['page']->value->template),$_smarty_tpl ) );?>
">Открыть шаблон <?php echo $_smarty_tpl->tpl_vars['page']->value->template;?>
</a></b><?php }?></span>
                                        </div>
                                    </div>

                                    <div class="col-md-6"></div>
                                </div>
                            </div>
                            <div class="justify-center mt-2">
                                <button type="submit" class="btn btn-success">Сохранить</button>
                            </div>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <div class="nk-block">
                            	<div class="nk-block-head">
                            		<h5 class="title">Описание</h5>
                            		<p>Краткое и полное описание страницы.</p>
                            	</div>

                                <?php $_smarty_tpl->_subTemplateRender("file:components/annotation-body.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('item'=>$_smarty_tpl->tpl_vars['page']->value,'type'=>"PageAdmin"), 0, false);
?>
                            </div>
                            <div class="justify-center mt-2">
                                <button type="submit" class="btn btn-success">Сохранить</button>
                            </div>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <?php $_smarty_tpl->_subTemplateRender("file:components/images.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('images'=>$_smarty_tpl->tpl_vars['page']->value->images,'dir'=>'pages'), 0, false);
?>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <?php $_smarty_tpl->_subTemplateRender("file:components/files.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('files'=>$_smarty_tpl->tpl_vars['page']->value->files), 0, false);
?>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                            <?php $_smarty_tpl->_subTemplateRender("file:components/related.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
                        </div>
                    </div>
                </div>

                                <div class="card card-bordered mb-3">
                    <div class="card-content">
                        <div class="card-inner">
                                                        <div id="js-update-properties">
                                <?php $_smarty_tpl->_subTemplateRender("file:components/properties.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

                        <div class="col-lg-4 card-box-right">
                <div class="card-box_sticky">
                                    <div class="card card-bordered mb-3">
                        <div class="card-content">
                            <div class="card-inner">
                                <div class="nk-block">
                                    <div class="nk-block-head">
                                        <h5 class="title">Параметры</h5>
                                    </div>
                                    <div class="form-group">
                                        <label class="form-label" for="page_visible">Активность</label>
                                        <span class="form-note">Включение или отключение страницы.</span>
                                        <div class="form-control-wrap">
                                            <div class="custom-control custom-switch">
                                                <input type="checkbox" name="visible" value="1" class="custom-control-input" id="page_visible" <?php if ($_smarty_tpl->tpl_vars['page']->value->visible) {?>checked<?php }?>>
                                                <label class="custom-control-label" for="page_visible"></label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="form-label" for="page_is_menu">Выводить страницу в меню</label>
                                        <span class="form-note">Страница выводится в меню сайта.</span>
                                        <div class="form-control-wrap">
                                            <div class="custom-control custom-switch">
                                                <input type="checkbox" name="is_menu" value="1" class="custom-control-input" id="page_is_menu" <?php if ($_smarty_tpl->tpl_vars['page']->value->is_menu) {?>checked<?php }?>>
                                                <label class="custom-control-label" for="page_is_menu"></label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="form-label" for="page_visible_submenu">Выводить подстраницы меню</label>
                                        <span class="form-note">Подстраницы выводятся в меню сайта.</span>
                                        <div class="form-control-wrap">
                                            <div class="custom-control custom-switch">
                                                <input type="checkbox" name="visible_submenu" value="1" class="custom-control-input" id="page_visible_submenu" <?php if ($_smarty_tpl->tpl_vars['page']->value->visible_submenu) {?>checked<?php }?>>
                                                <label class="custom-control-label" for="page_visible_submenu"></label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                                        <div class="card card-bordered mb-3">
                        <div class="card-content">
                            <div class="card-inner">
                                <?php $_smarty_tpl->_subTemplateRender("file:components/meta.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('item'=>$_smarty_tpl->tpl_vars['page']->value,'url'=>'/'), 0, false);
?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<?php }
/* smarty_template_function_section_select_134219554167dfcc4b4f6b57_87854501 */
if (!function_exists('smarty_template_function_section_select_134219554167dfcc4b4f6b57_87854501')) {
function smarty_template_function_section_select_134219554167dfcc4b4f6b57_87854501(Smarty_Internal_Template $_smarty_tpl,$params) {
foreach ($params as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value, $_smarty_tpl->isRenderingCache);
}
?>

                                                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pages']->value, 'p');
$_smarty_tpl->tpl_vars['p']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['p']->value) {
$_smarty_tpl->tpl_vars['p']->do_else = false;
?>
                                                                                                                        <?php if ($_smarty_tpl->tpl_vars['page']->value->id != $_smarty_tpl->tpl_vars['p']->value->id) {?>
                                                                <option value='<?php echo $_smarty_tpl->tpl_vars['p']->value->id;?>
' data-template='<?php if (!empty($_smarty_tpl->tpl_vars['p']->value->subpages)) {
echo $_smarty_tpl->tpl_vars['p']->value->subpages[0]->template;
}?>' <?php if ($_smarty_tpl->tpl_vars['page']->value->parent_id == $_smarty_tpl->tpl_vars['p']->value->id) {?>selected<?php }?>>
                                                                    <?php
$__section_sp_0_loop = (is_array(@$_loop=$_smarty_tpl->tpl_vars['level']->value) ? count($_loop) : max(0, (int) $_loop));
$__section_sp_0_total = $__section_sp_0_loop;
$_smarty_tpl->tpl_vars['__smarty_section_sp'] = new Smarty_Variable(array());
if ($__section_sp_0_total !== 0) {
for ($__section_sp_0_iteration = 1, $_smarty_tpl->tpl_vars['__smarty_section_sp']->value['index'] = 0; $__section_sp_0_iteration <= $__section_sp_0_total; $__section_sp_0_iteration++, $_smarty_tpl->tpl_vars['__smarty_section_sp']->value['index']++){
?>&mdash;<?php
}
}
echo $_smarty_tpl->tpl_vars['p']->value->name;?>

                                                                </option>
                                                                <?php $_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction($_smarty_tpl, 'section_select', array('pages'=>$_smarty_tpl->tpl_vars['p']->value->subpages,'level'=>$_smarty_tpl->tpl_vars['level']->value+1), true);?>

                                                            <?php }?>
                                                        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                                    <?php
}}
/*/ smarty_template_function_section_select_134219554167dfcc4b4f6b57_87854501 */
}
