<?php
/* Smarty version 4.5.2, created on 2024-08-14 11:31:23
  from '/home/life/public_html/teg.lifestyle.uz/admin/templates/views/sections/section.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.2',
  'unifunc' => 'content_66bc958b321043_96077216',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '35276a7ba1421ec0c860902d822b4a037e6707bf' => 
    array (
      0 => '/home/life/public_html/teg.lifestyle.uz/admin/templates/views/sections/section.tpl',
      1 => 1715433066,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:components/group-buttons.tpl' => 1,
    'file:components/page-header.tpl' => 1,
    'file:components/fields/select.tpl' => 6,
    'file:components/image-preview.tpl' => 1,
    'file:tinymce_init.tpl' => 1,
    'file:uploads_init.tpl' => 1,
  ),
),false)) {
function content_66bc958b321043_96077216 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/home/life/public_html/teg.lifestyle.uz/includes/composer/vendor/smarty/smarty/libs/plugins/function.html_options.php','function'=>'smarty_function_html_options',),1=>array('file'=>'/home/life/public_html/teg.lifestyle.uz/includes/composer/vendor/smarty/smarty/libs/plugins/modifier.date_format.php','function'=>'smarty_modifier_date_format',),));
?>
<!-- Inner content -->
<form method="post" id="section" enctype="multipart/form-data">

	<?php ob_start();
if (!empty($_smarty_tpl->tpl_vars['page']->value)) {
echo "page=";
echo (string)$_smarty_tpl->tpl_vars['page']->value;
}
$_prefixVariable1=ob_get_clean();
ob_start();
if (!empty($_smarty_tpl->tpl_vars['parentId']->value)) {
echo "&parentId=";
echo (string)$_smarty_tpl->tpl_vars['parentId']->value;
}
$_prefixVariable2=ob_get_clean();
$_smarty_tpl->_subTemplateRender("file:components/group-buttons.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('url'=>((string)$_smarty_tpl->tpl_vars['adminUrl']->value)."/sections?".$_prefixVariable1.$_prefixVariable2), 0, false);
?>

	<?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "breadcrumb", null, null);?>
		<a href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/sections" class="breadcrumb-item"><?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['title']->value ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
</a>
		<span class="breadcrumb-item active">Добавить</span>
	<?php $_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>
	<?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "showBy", null, null);
$_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>

	<?php $_smarty_tpl->_subTemplateRender("file:components/page-header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('buttons'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'buttons'),'breadcrumb'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'breadcrumb'),'showBy'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'showBy')), 0, false);
?>
	<!-- /page header -->

	<div class="content">
		<div class="row">
			<div class="col-md-8">
				<div class="card border shadow-sm">
					<div class="card-header d-flex flex-wrap">
						<h6 class="mb-0">Основное</h6>
						<div class="d-inline-flex ms-auto">
							<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
						</div>
					</div>
					<div class="collapse show">
						<div class="card-body">
							<div class="row">
								<div class="col-md-6">
									<div class="form-group mb-3">
										<label class="form-label <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['error_parent_type'])) || (isset($_smarty_tpl->tpl_vars['errors']->value['sectionType']))) {?>text-danger<?php }?>">Тип</label>
										<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['types']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['type'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'name'=>"section[type]",'class'=>"form-control select",'id'=>"type"),$_smarty_tpl);?>

									</div>
								</div>
								<div class="col-md-6">
									<div class="form-group mb-3">
										<label class="form-label <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['error_parent_typeContent'])) || (isset($_smarty_tpl->tpl_vars['errors']->value['error_typeContent']))) {?>text-danger<?php }?>">Тип контента</label>
										<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['typeContents']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['typeContent'] ?? null)===null||$tmp==='' ? 'articles' ?? null : $tmp),'name'=>"section[typeContent]",'class'=>"form-control select",'id'=>"typeContent"),$_smarty_tpl);?>

									</div>
								</div>
								<div class="col-md-12">
									<div class="form-group mb-3">
										<label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['parentId']))) {?>text-danger<?php }?>">Родительский раздел</label>
										<?php if ((isset($_smarty_tpl->tpl_vars['parents']->value))) {?>
											<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['parentId']))) {?>
												<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['parents']->value,'selected'=>$_smarty_tpl->tpl_vars['section']->value['parentId'],'id'=>"parentId",'name'=>"section[parentId]",'class'=>"form-control select"),$_smarty_tpl);?>

											<?php } else { ?>
												<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['parents']->value,'id'=>"parentId",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['parentId']->value ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'name'=>"section[parentId]",'class'=>"form-control select"),$_smarty_tpl);?>

											<?php }?>

										<?php } else { ?>
											<label class="form-label">Н/Д</label>
											<input type="hidden" name="section[parentId]" value="0"/>
										<?php }?>
									</div>
								</div>
								<div class="col-md-6">
									<div class="form-group mb-3">
										<label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['name']))) {?>text-danger<?php }?>">Имя</label>
										<input type="text" class="form-control" autocomplete="off" id="name" name="section[name]" value="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['name']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['name'], ENT_QUOTES, 'UTF-8', true);
}?>" />
									</div>
								</div>
								<div class="col-md-6">
									<div class="form-group mb-3">
										<label class="form-label is-visible">Альтернативное имя</label>
										<input type="text" class="form-control" autocomplete="off" id="alias" name="section[alias]" value="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['alias']))) {
echo $_smarty_tpl->tpl_vars['section']->value['alias'];
}?>"/>
									</div>
								</div>
								<div class="col-md-12">
									<div class="form-group mb-3">
										<label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileName'])) || (isset($_smarty_tpl->tpl_vars['errors']->value['fileNameExists'])) || (isset($_smarty_tpl->tpl_vars['errors']->value['fileNameProhibited'])) || (isset($_smarty_tpl->tpl_vars['errors']->value['fileNameCharacters']))) {?>text-danger<?php }?>">URL</label>
										<input type="text" class="form-control" id="fileName" name="section[fileName]" value="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['fileName']))) {
echo htmlspecialchars((string)htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['fileName'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8', true);
}?>" />
									</div>
								</div>

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

								<div class="collapse <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['enableGallery'])) && $_smarty_tpl->tpl_vars['section']->value['enableGallery'] == 1) {?>show<?php }?>" id="gallery-card">
					<div class="card border shadow-sm">
						<div class="card-header d-flex flex-wrap">
							<h6 class="mb-0">Фотогалерея</h6>
							<div class="d-inline-flex ms-auto">
								<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
							</div>
						</div>

						<div class="collapse show">

							<div class="card-body">
								<div class="row gallery gallery-product gallery-sortable mt-2 sortable" id="fileList">
									<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['gallery']))) {?>
										<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['section']->value['gallery'], 'file');
$_smarty_tpl->tpl_vars['file']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['file']->value) {
$_smarty_tpl->tpl_vars['file']->do_else = false;
?>
											<figure class="gallery-item gallery-item-images mb-0" id="gallery-item-<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
" data-id="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
">
												<div class="move_zone image">
													<img src="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['medium'], ENT_QUOTES, 'UTF-8', true);?>
" alt="<?php if ((isset($_smarty_tpl->tpl_vars['file']->value['title']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['title'], ENT_QUOTES, 'UTF-8', true);
}?>"/>
													<ul class="gallery-item-controls">
														<li><span><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['orderBy'], ENT_QUOTES, 'UTF-8', true);?>
</span></li>
														<li>
		                                                    <span class="edit_image" id="edit_image_<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
"
																  data-id="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
"
																  data-title="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['title'], ENT_QUOTES, 'UTF-8', true);?>
"
																  data-alias="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['alias'], ENT_QUOTES, 'UTF-8', true);?>
"
																  data-description="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['description'], ENT_QUOTES, 'UTF-8', true);?>
"
																  data-link="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['link'], ENT_QUOTES, 'UTF-8', true);?>
"
																  data-position="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['position'], ENT_QUOTES, 'UTF-8', true);?>
"
																  onclick="editPictureInfo(<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
, 'Добавить описание к картинке', 'section');"><i class="ph-note-pencil"></i></span>
														<li>
															<span onclick="deletePicture(<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
, 'section');"><i class="ph-trash"></i></span>
														</li>
													</ul>
												</div>
												<div class="meta" id="meta_image_<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
">
													<span id="im_title" class="fs-sm fw-normal fw-semibold"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['title'], ENT_QUOTES, 'UTF-8', true);?>
</span>
													<span id="im_alias" class="fs-sm fw-normal"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['alias'], ENT_QUOTES, 'UTF-8', true);?>
</span>
													<span id="im_description" class="fs-sm fw-normal"><?php echo $_smarty_tpl->tpl_vars['file']->value['description'];?>
</span>
													<span id="im_link" class="fs-sm fw-normal"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['link'], ENT_QUOTES, 'UTF-8', true);?>
</span>
													<span id="im_position" class="badge bg-primary text-white fs-sm fw-light"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['position'], ENT_QUOTES, 'UTF-8', true);?>
</span>
												</div>
											</figure>
										<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
									<?php }?>
								</div>
							</div>

							<div class="card-footer d-sm-flex justify-content-sm-between align-items-sm-center py-sm-2">
								<button type="button" class="btn btn-sm btn-primary btn-upload read-more" data-type="gallery" data-path="/" data-action="read_more"><i class="ph-image me-2"></i> Загрузить файлы </button>
								<button type="button" class="btn btn-sm btn-primary btn-sorting collapse"><i class="icon-checkmark3 me-2"></i> Применить</button>
							</div>

						</div>

					</div>
				</div>
				
				<div class="card border shadow-sm">
					<div class="card-header d-flex flex-wrap">
						<h6 class="mb-0">Описание</h6>
						<div class="d-inline-flex ms-auto">
							<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
						</div>
					</div>
					<div class="collapse show">
						<div class="card-body flex-column flex-md-row m-0 p-0">
							<textarea name="section[content]" class="description"><?php if ((isset($_smarty_tpl->tpl_vars['section']->value['content']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['content'], ENT_QUOTES, 'UTF-8', true);
}?></textarea>
						</div>
					</div>
				</div>
			</div>


			<div class="col-md-4">
								<div class="card border shadow-sm">

					<div class="card-header d-flex flex-wrap">
						<h6 class="mb-0">Статус и видимость</h6>
						<div class="d-inline-flex ms-auto">
							<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
						</div>
					</div>
					<div class="collapse show">
						<div class="card-body">
														<?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"status",'title'=>"Статус",'field'=>"section[status]",'array'=>$_smarty_tpl->tpl_vars['statuses']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['status'] ?? null)===null||$tmp==='' ? 'visible' ?? null : $tmp),'class'=>"form-group mb-3"), 0, false);
?>
							
							<div class="form-group mb-3">
								<label class="form-label is-visible">Тип ссылки <br /><i><code class="p-0">если нужно чтоб переходило на <b>стороний сайт</b> или перейти на какую то <b>другую страницу</b>, укажите (Внешняя ссылка) и <b>обязательно прописать ссылку</b></code></i></label>
								<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['urlTypes']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['urlType'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'name'=>"section[urlType]",'class'=>"form-control select selectUrlType",'id'=>"selectUrlType"),$_smarty_tpl);?>

							</div>
							<div class="form-group mb-3 collapse <?php if (!empty($_smarty_tpl->tpl_vars['section']->value['urlType']) && $_smarty_tpl->tpl_vars['section']->value['urlType'] == 'external') {?>show<?php }?>" id="icon-urlType">
								<label class="form-label is-visible  <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['externalLink']))) {?>text-danger<?php }?>">Ссылка <code>(t.me/@life)</code></label>
								<input type="text" class="form-control" id="link" name="section[externalLink]" value="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['externalLink']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['externalLink'], ENT_QUOTES, 'UTF-8', true);
}?>"/>
							</div>
							<div class="form-group mb-2">
								<div class="form-check form-check-inline">
									<input type="checkbox" class="form-check-input" id="showMainPage" name="section[showMainPage]" value="1" <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['showMainPage'])) && $_smarty_tpl->tpl_vars['section']->value['showMainPage'] == 1) {?>checked<?php }?>>
									<label class="form-check-label" for="showMainPage">Показать как блок</label>
								</div>
							</div>
							<div class="form-group mb-2">
								<div class="form-check form-check-inline">
									<input type="checkbox" class="form-check-input" id="topMenu" name="section[topMenu]" value="1" <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['topMenu'])) && $_smarty_tpl->tpl_vars['section']->value['topMenu'] == 1) {?>checked<?php }?>>
									<label class="form-check-label" for="topMenu">Отображать в главном меню сайта</label>
								</div>
							</div>
							<div class="form-group mb-2">
								<div class="form-check form-check-inline">
									<input type="checkbox" class="form-check-input" id="footerMenu" name="section[footerMenu]" value="1" <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['footerMenu'])) && $_smarty_tpl->tpl_vars['section']->value['footerMenu'] == 1) {?>checked<?php }?>>
									<label class="form-check-label" for="footerMenu">Отображать в нижнем меню сайта</label>
								</div>
							</div>
							<div class="form-group mb-2">
								<div class="form-check form-check-inline">
									<input type="checkbox" class="form-check-input" id="enableGallery" name="section[enableGallery]" value="1" <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['enableGallery'])) && $_smarty_tpl->tpl_vars['section']->value['enableGallery'] == 1) {?>checked<?php }?> data-bs-toggle="collapse" data-bs-target="#gallery-card" aria-expanded="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['enableGallery'])) && $_smarty_tpl->tpl_vars['section']->value['enableGallery'] == 1) {?>true<?php } else { ?>false<?php }?>">
									<label class="form-check-label" for="enableGallery">Фотогалерея в этом разделе</label>
								</div>
							</div>
							<div class="mb-2">
								<div class="form-check form-check-inline mb-2">
									<input type="checkbox" class="form-check-input" id="enableIcon" name="section[enableIcon]" value="1" <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['enableIcon'])) && $_smarty_tpl->tpl_vars['section']->value['enableIcon'] == 1) {?>checked<?php }?> data-bs-toggle="collapse" data-bs-target="#icon-enable" aria-expanded="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['enableIcon'])) && $_smarty_tpl->tpl_vars['section']->value['enableIcon'] == 1) {?>true<?php } else { ?>false<?php }?>">
									<label class="form-check-label" for="enableIcon">Иконка в этом разделе</label>
								</div>

								<div class="form-group mb-3 collapse <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['enableIcon'])) && $_smarty_tpl->tpl_vars['section']->value['enableIcon'] == 1) {?>show<?php }?>" id="icon-enable">
									<label class="form-label is-visible">Иконка раздела</label>
									<input type="text" class="form-control" autocomplete="off" id="icon" name="section[icon]" value="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['icon']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['icon'], ENT_QUOTES, 'UTF-8', true);
}?>"/>
								</div>
							</div>
						</div>
						<div class="card-footer hstack gap-3 justify-content-between">
							<div class="text-muted">
								<ul class="list list-unstyled mb-0 fs-sm">
									<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['addedOn']))) {?><li>Создано</li><?php }?>
									<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['modifiedOn']))) {?><li>Изменено</li><?php }?>
								</ul>
							</div>
							<div class="hstack gap-1">
								<ul class="list list-unstyled mb-0 fs-sm">
									<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['addedOn']))) {?><li><?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['section']->value['addedOn'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['section']->value['addedBy']['loginName'] ?? null)===null||$tmp==='' ? "Неизвестный пользователь" ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
)</li><?php }?>
									<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['modifiedOn']))) {?> <li><?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['section']->value['modifiedOn'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['section']->value['modifiedBy']['loginName'] ?? null)===null||$tmp==='' ? "Неизвестный пользователь" ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
)</li><?php }?>
								</ul>
							</div>
						</div>
					</div>
				</div>
				
				<?php ob_start();
if ((isset($_smarty_tpl->tpl_vars['section']->value['image']))) {
echo (string)$_smarty_tpl->tpl_vars['section']->value['image']['original'];
}
$_prefixVariable3=ob_get_clean();
ob_start();
if ((isset($_smarty_tpl->tpl_vars['section']->value['image']))) {
echo (string)$_smarty_tpl->tpl_vars['section']->value['image']['imageId'];
}
$_prefixVariable4=ob_get_clean();
$_smarty_tpl->_subTemplateRender("file:components/image-preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('image'=>$_prefixVariable3,'id'=>$_prefixVariable4,'module'=>'section'), 0, false);
?>

								<div class="card border shadow-sm">
					<div class="card-header d-flex flex-wrap">
						<h6 class="mb-0">Брошюра (pdf, word)</h6>
						<div class="d-inline-flex ms-auto">
							<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
						</div>
					</div>
					<div class="collapse show">
						<div class="card-body">
							<div class="form-group" id="pdf_docs">
								<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['docs']))) {?>
									<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['section']->value['docs'], 'file');
$_smarty_tpl->tpl_vars['file']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['file']->value) {
$_smarty_tpl->tpl_vars['file']->do_else = false;
?>
										<figure class="docs mb-2" id="docs-item-<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
">
											<?php if ($_smarty_tpl->tpl_vars['file']->value['fileFormat'] == 'pdf') {?>
												<embed src="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['original'], ENT_QUOTES, 'UTF-8', true);?>
" width="100%" height="100%" class="mb-2" type="application/pdf"/>
											<?php }?>
											<div class="input-group">
												<span class="input-group-text"><img src="/admin/assets/ico/<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['fileFormat'], ENT_QUOTES, 'UTF-8', true);?>
.svg" width="30"/></span>
												<input type="text" class="form-control" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['fileName'], ENT_QUOTES, 'UTF-8', true);?>
" placeholder="" readonly>
												<button type="button" class="btn btn-danger" onclick="deleteDocs(<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['file']->value['imageId'], ENT_QUOTES, 'UTF-8', true);?>
, 'section');"><i class="ph-trash"></i></button>
											</div>
										</figure>
									<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
								<?php }?>
							</div>
						</div>
						<div class="card-footer d-sm-flex justify-content-sm-between align-items-sm-center py-sm-2">
							<button type="button" class="btn btn-sm btn-primary btn-upload btn-docs read-more" data-type="docs" data-path="/" data-action="read_more"><i class="ph-file-doc me-2"></i> Загрузить файл </button>
						</div>
					</div>
				</div>

								<div class="card border shadow-sm">
					<div class="card-header d-flex flex-wrap">
						<h6 class="mb-0">Seo</h6>
						<div class="d-inline-flex ms-auto">
														<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
						</div>
					</div>

					<div class="collapse show">
						<div class="card-body flex-column flex-md-row m-0">
							<div class="form-group mb-3">
								<div class="form-check form-check-inline mb-2">
									<input type="checkbox" class="form-check-input" id="sitemap" name="section[sitemap]" value="Y" <?php if ((isset($_smarty_tpl->tpl_vars['section']->value['sitemap'])) && $_smarty_tpl->tpl_vars['section']->value['sitemap'] == 'Y') {?>checked<?php }?> aria-expanded="<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['sitemap'])) && $_smarty_tpl->tpl_vars['section']->value['sitemap'] == 'Y') {?>true<?php } else { ?>false<?php }?>">
									<label class="form-check-label" for="sitemap">Добавить данный раздел в sitemap.xml</label>
								</div>
							</div>
							<div class="form-group mb-3">
								<label class="form-label is-visible">Ключевые слова (Meta keywords)</label>
								<textarea name="section[keywords]" id="keywords" class="form-control" rows="4"><?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['section']->value['keywords'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
</textarea>
																															</div>

							<div class="form-group mb-3">
								<label class="form-label is-visible">Описание (Meta description)</label>
								<textarea name="section[description]" id="description" class="form-control" rows="4"><?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['section']->value['description'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
</textarea>
							</div>
						</div>
					</div>
				</div>

								<div class="card border shadow-sm card-collapsed">
					<div class="card-header d-flex flex-wrap">
						<h6 class="mb-0">Дополнительно</h6>
						<div class="d-inline-flex ms-auto">
							<a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
						</div>
					</div>
					<div class="collapse">
						<div class="card-body">
							<fieldset class="mb-3">
								<legend class="fs-base fw-bold border-bottom pb-2 mb-3">Применение для данного Раздел</legend>

								<div class="mb-3">
									<label class="form-label is-visible">Шаблон</label>
									<?php echo smarty_function_html_options(array('values'=>$_smarty_tpl->tpl_vars['templates']->value,'output'=>$_smarty_tpl->tpl_vars['templates']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['templateName'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'name'=>"section[templateName]",'class'=>"form-control form-control-sm select"),$_smarty_tpl);?>

								</div>
																<?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"isCached",'title'=>"Кэширование",'field'=>"section[isCached]",'array'=>$_smarty_tpl->tpl_vars['paramCaching']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['isCached'] ?? null)===null||$tmp==='' ? 0 ?? null : $tmp),'class'=>"form-group mb-2"), 0, true);
?>
								
								<div class="mb-3">
									<div class="input-group">
										<button type="button" class="btn btn-success"><i class="icon-watch2"></i></button>
										<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cachingTimeOptions']->value,'name'=>"section[cacheTime]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['cacheTime'] ?? null)===null||$tmp==='' ? 1 ?? null : $tmp),'class'=>"form-control form-control-sm select",'data-width'=>"1%"),$_smarty_tpl);?>

										<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cachingPeriodOptions']->value,'name'=>"section[cachePeriod]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['cachePeriod'] ?? null)===null||$tmp==='' ? 86400 ?? null : $tmp),'class'=>"form-control form-control-sm select",'data-width'=>"1%"),$_smarty_tpl);?>

									</div>
								</div>

																<?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"commentsEnabled",'title'=>"Комментарии",'field'=>"section[commentsEnabled]",'array'=>$_smarty_tpl->tpl_vars['paramComments']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['commentsEnabled'] ?? null)===null||$tmp==='' ? 0 ?? null : $tmp),'class'=>"form-group mb-3"), 0, true);
?>
															</fieldset>

							<fieldset class="form-group mb-3">
								<legend class="fs-base fw-bold border-bottom pb-2 mb-3">Применение для подразделов данного раздела</legend>
								<div class="mb-3">
									<label class="form-label is-visible">Шаблон</label>
									<?php echo smarty_function_html_options(array('values'=>$_smarty_tpl->tpl_vars['templates']->value,'output'=>$_smarty_tpl->tpl_vars['templates']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['subTemplateName'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'name'=>"section[subTemplateName]",'class'=>"form-control form-control-sm select"),$_smarty_tpl);?>

								</div>

																<?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"subIsCached",'title'=>"Кэширование",'field'=>"section[subIsCached]",'array'=>$_smarty_tpl->tpl_vars['paramCaching']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['subIsCached'] ?? null)===null||$tmp==='' ? 0 ?? null : $tmp),'class'=>"form-group mb-2"), 0, true);
?>
								
								<div class="mb-3">
									<div class="input-group">
										<button type="button" class="btn btn-success"><i class="icon-watch2"></i></button>
										<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cachingTimeOptions']->value,'name'=>"section[subCacheTime]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['subCacheTime'] ?? null)===null||$tmp==='' ? 1 ?? null : $tmp),'class'=>"form-control form-control-sm select",'data-width'=>"1%"),$_smarty_tpl);?>

										<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cachingPeriodOptions']->value,'name'=>"section[subCachePeriod]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['subCachePeriod'] ?? null)===null||$tmp==='' ? 86400 ?? null : $tmp),'class'=>"form-control form-control-sm select",'data-width'=>"1%"),$_smarty_tpl);?>

									</div>
								</div>

																<?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"subCommentsEnabled",'title'=>"Комментарии",'field'=>"section[subCommentsEnabled]",'array'=>$_smarty_tpl->tpl_vars['paramComments']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['subCommentsEnabled'] ?? null)===null||$tmp==='' ? 0 ?? null : $tmp),'class'=>"form-group mb-3"), 0, true);
?>
								
							</fieldset>


							<fieldset class="form-group mb-3">
								<legend class="fs-base fw-bold border-bottom pb-2 mb-3">Применение для контента данного раздела</legend>
								<div class="form-group mb-3">
									<label class="form-label is-visible">Шаблон</label>
									<?php echo smarty_function_html_options(array('values'=>$_smarty_tpl->tpl_vars['templates']->value,'output'=>$_smarty_tpl->tpl_vars['templates']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['artTemplateName'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp),'name'=>"section[artTemplateName]",'class'=>"form-control form-control-sm select"),$_smarty_tpl);?>

								</div>

																<?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('id'=>"artIsCached",'title'=>"Кэширование",'field'=>"section[artIsCached]",'array'=>$_smarty_tpl->tpl_vars['paramCaching']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['artIsCached'] ?? null)===null||$tmp==='' ? 0 ?? null : $tmp),'class'=>"form-group mb-2"), 0, true);
?>
								
								<div class="input-group">
									<button type="button" class="btn btn-success"><i class="icon-watch2"></i></button>
									<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cachingTimeOptions']->value,'name'=>"section[artCacheTime]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['artCacheTime'] ?? null)===null||$tmp==='' ? 1 ?? null : $tmp),'class'=>"form-control form-control-sm select",'data-width'=>"1%"),$_smarty_tpl);?>

									<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cachingPeriodOptions']->value,'name'=>"section[artCachePeriod]",'selected'=>(($tmp = $_smarty_tpl->tpl_vars['section']->value['artCachePeriod'] ?? null)===null||$tmp==='' ? 86400 ?? null : $tmp),'class'=>"form-control form-control-sm select",'data-width'=>"1%"),$_smarty_tpl);?>

								</div>

							</fieldset>

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

			</div>

			<div class="col-md-12 main main_buttons text-center">
				<?php if ((isset($_smarty_tpl->tpl_vars['section']->value['sectionId']))) {?><input type="hidden" class="form-control" id="id" name="id" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['sectionId'], ENT_QUOTES, 'UTF-8', true);?>
"><?php }?>
				<?php echo $_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'buttons');?>

			</div>

		</div>
	</div>
</form>

<?php $_smarty_tpl->_subTemplateRender('file:tinymce_init.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<?php $_smarty_tpl->_subTemplateRender('file:uploads_init.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<?php echo '<script'; ?>
>
	$(document).ready(function () {

		<?php if ((isset($_smarty_tpl->tpl_vars['messages']->value['saved']))) {?> new Noty({ text: 'Раздел «<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
» сохранен.', type: 'success' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['messages']->value['deleted']))) {?> new Noty({ text: 'Раздел «<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
» удален.', type: 'success' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['messages']->value['sorted']))) {?> new Noty({ text: 'Разделы отсортированы.', type: 'success' }).show();<?php }?>

		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['not_saved']))) {?> new Noty({ text: 'Раздел «<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['section']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
» НЕ сохранен.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['section_not_found']))) {?> new Noty({ text: 'Раздел не найден.', type: 'error' }).show();<?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['name']))) {?> new Noty({ text: 'Введите название раздела.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileName']))) {?> new Noty({ text: 'Введите URL раздела.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileNameExists']))) {?> new Noty({ text: 'Раздел с таким URL уже существует.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['htaccess']))) {?> new Noty({ text: 'Невозможно сохранить файл .htaccess.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['serializations']))) {?> new Noty({ text: 'Невозможно сохранить сериальный файл.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileNameProhibited']))) {?> new Noty({ text: 'Такое URL запрещен.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileNameCharacters']))) {?> new Noty({ text: 'URL может состоять только из следующих символов: A-Z a-z 0-9 . , - _', type: 'error' }).show(); <?php }?>

		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['error_typeContent']))) {?> new Noty({ text: 'Невозможно поменять тип. За разделом закреплены подразделы или контент.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['error_parent_typeContent']))) {?> new Noty({ text: 'Тип контента не соответствует основному разделу.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['error_parent_type']))) {?> new Noty({ text: 'Раздел не может быть страницей!', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['sectionType']))) {?> new Noty({ text: 'Невозможно поменять тип. За разделом закреплены подразделы или контент.', type: 'error' }).show(); <?php }?>
		<?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['externalLink']))) {?> new Noty({ text: 'Укажите ссылку на модальное окно или внешнюю ссылку', type: 'error' }).show(); <?php }?>


		var type = $('#type :selected').val();
		if (type === 'plain') {
			$('#typeContent').prop("disabled", true);
			$('.pages').hide();
		}

		$('#type').change(function() {
			var typeContent = $(this).val();
			$('#typeContent').prop("disabled", true);
			$('.pages').hide();
			if (typeContent === 'tree') {
				$('.pages').show();
				$('#typeContent').prop("disabled", false);
			}
		});

		$('#typeContent').change(function() {
			var typeContent = $(this).val();
			$('.company_contacts').hide();
			if (typeContent === 'products') {
				$('.company_contacts').show();
			}
		});

		// сортировать фотогалею
		$(document).on('click', '.sortable_save_button', function () {
			var ids = new Array();
			$('#fileList figure.gallery-item').each(function () {
				console.log($(this).attr('data-id'))

				ids.push($(this).attr('data-id'));
			})
			$.post( "<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/section?action=sortPictures", { imageIds : ids }, function() {
				$('.sortable_footer_navbar').removeClass('show');
				$("#fileList").load(location.href + " figure.gallery-item");
				new Noty({ text: 'Фотогалерея отсортирована', type: 'success' }).show();
			});
		})

		$(document).on('click', '.sortable_cancel_button', function () {
			$('.sortable_footer_navbar').removeClass('show');
			$("#fileList").load(location.href + " figure.gallery-item");
		})


		$(document).on('click', '#enableIcon', function(){
			if (!$(this).is(':checked'))
				$('#icon').val('');
		});

		$('#selectUrlType').change(function(){
			console.log($('#selectUrlType').val())
			if($('#selectUrlType').val() === 'external') {
				if (!$("#icon-urlType").hasClass("show"))
					$('#icon-urlType').addClass("show");
			} else {
				if ($("#icon-urlType").hasClass("show"))
					$('#icon-urlType').removeClass("show");

			}
		});
	});

	$(function () { function e() { alias_touched || $("#alias").val(a()), keywords_touched || $("#keywords").val(i()), description_touched || $("#description").val(t()), fileName_touched || $("#fileName").val(n()) } function a() { return name = $("#name").val() } function m() { return name = $("#name").val() } function i() { return name = $("#name").val() } function t() { return name = $("#name").val() } function n() { return fileName = $("#name").val(), fileName = fileName.replace(/[\s]+/gi, "<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['filename_word_separator'], ENT_QUOTES, 'UTF-8', true);?>
"), fileName = l(fileName), fileName = fileName.replace(/[^0-9a-z_\-]+/gi, "").toLowerCase() } function l(e) { for (var a = "А-а-Б-б-В-в-Ґ-ґ-Г-г-Д-д-Е-е-Ё-ё-Є-є-Ж-ж-З-з-И-и-І-і-Ї-ї-Й-й-К-к-Л-л-М-м-Н-н-О-о-П-п-Р-р-С-с-Т-т-У-у-Ф-ф-Х-х-Ц-ц-Ч-ч-Ш-ш-Щ-щ-Ъ-ъ-Ы-ы-Ь-ь-Э-э-Ю-ю-Я-я".split("-"), i = "A-a-B-b-V-v-G-g-G-g-D-d-E-e-E-e-E-e-ZH-zh-Z-z-I-i-I-i-I-i-J-j-K-k-L-l-M-m-N-n-O-o-P-p-R-r-S-s-T-t-U-u-F-f-H-h-TS-ts-CH-ch-SH-sh-SCH-sch-'-'-Y-y-'-'-E-e-YU-yu-YA-ya".split("-"), t = "", n = 0, l = e.length; l > n; n++) {
		var o = e.charAt(n),c = a.indexOf(o);t += c >= 0 ? i[c] : o
	} return t }
		alias_touched = !0,
				keywords_touched = !0,
				description_touched = !0,
				fileName_touched = !0,
		($("#alias").val() == a() || "" == $("#alias").val()) && (alias_touched = !1),
		($("#keywords").val() == i() || "" == $("#keywords").val()) && (keywords_touched = !1),
		($("#description").val() == t() || "" == $("#description").val()) && (description_touched = !1),
		($("#fileName").val() == n() || "" == $("#fileName").val()) && (fileName_touched = !1),
				$("#alias").change( function () { alias_touched = !0 }),
				$("#keywords").change( function () { keywords_touched = !0 }),
				$("#description").change( function () { description_touched = !0 }),
				$("#fileName").change( function () { fileName_touched = !0 }),
				$("#name").keyup( function () { e() })
	});

<?php echo '</script'; ?>
>


<?php }
}
