kokjan/frontend/themes/mali/views/layouts/_menu.php

171 lines
5.9 KiB
PHP
Raw Normal View History

2026-02-25 06:59:34 +00:00
<?php
use common\models\CmsPage;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm; ?>
<style>
/* Sidebar Wrapper */
#menu-sidebar-container {
background: #fff;
border-right: 1px solid #eee;
padding-bottom: 2rem;
2026-02-25 06:59:34 +00:00
}
/* Section Banner Style - Consistent Gold Gradient */
.banner {
width: 100%;
margin-top: 15px;
margin-bottom: 5px;
padding: 12px 0;
background: linear-gradient(90deg, #FFC068 0%, #ff8f00 50%, #FFC068 100%);
border-top: 2px solid #fff;
border-bottom: 2px solid #fff;
box-shadow: 0 4px 10px rgba(255, 143, 0, 0.15);
display: flex;
justify-content: center;
align-items: center;
position: relative;
2026-02-25 06:59:34 +00:00
}
/* Traditional Thai Accent */
.banner::before, .banner::after {
content: '';
position: absolute;
width: 20px;
height: 100%;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='40' viewBox='0 0 20 40'%3E%3Cpath d='M0 20 Q10 0 20 20 Q10 40 0 20' fill='%23ffffff' fill-opacity='0.2'/%3E%3C/svg%3E");
background-repeat: repeat-y;
2026-02-25 06:59:34 +00:00
}
.banner::before { left: 5px; }
.banner::after { right: 5px; }
2026-02-25 06:59:34 +00:00
.banner-text {
2026-02-25 06:59:34 +00:00
color: #fff;
font-weight: 700;
font-size: 18px !important;
text-shadow: 1px 1px 2px rgba(44, 24, 16, 0.2);
letter-spacing: 0.5px;
font-family: 'Kanit', sans-serif !important;
}
/* Menu List Style */
.thai-menu-list {
margin-bottom: 20px;
}
.thai-menu-item {
color: #2c1810 !important; /* Deep Brown */
background-color: #fff;
padding: 12px 20px;
border-bottom: 1px solid #fff5ed !important;
transition: all 0.3s ease;
font-size: 15px;
display: flex;
align-items: center;
text-decoration: none !important;
border-left: 5px solid transparent;
font-family: 'Google Sans', 'Product Sans', sans-serif !important;
font-weight: 500;
}
/* Hover & Active State: Matching Top Navbar Gold Gradient */
.thai-menu-item:hover, .thai-menu-item.active {
background: linear-gradient(135deg, #FFC068 0%, #ff8f00 100%) !important;
color: #fff !important;
border-left: 5px solid #8e1d1d; /* Dark Red Accent */
padding-left: 25px;
box-shadow: 0 4px 12px rgba(255, 143, 0, 0.2);
}
.thai-menu-item i {
margin-right: 12px;
color: #FFC068; /* Warm Gold Icons */
width: 20px;
text-align: center;
font-size: 16px;
transition: all 0.3s ease;
}
.thai-menu-item:hover i, .thai-menu-item.active i {
color: #FFDBBB !important; /* Soft Peach Icon on Hover */
transform: scale(1.1);
2026-02-25 06:59:34 +00:00
}
/* Service Icons Grid */
.service-grid {
padding: 15px;
display: flex;
flex-direction: column;
gap: 15px;
2026-02-25 06:59:34 +00:00
}
.service-link {
display: block;
transition: transform 0.2s ease;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.service-link:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
/* Utility */
.mt-20 { margin-top: 20px; }
2026-02-25 06:59:34 +00:00
</style>
<div id="menu-sidebar-container">
2026-02-27 02:56:17 +00:00
<?php
$leftMenus = Yii::$app->abt->getFrontendMenu('left_menu');
foreach ($leftMenus as $section): ?>
<div class="sidebar-section">
<div class="banner">
<span class="banner-text"><?= $section['name'] ?></span>
</div>
<?php if (!empty($section['items'])): ?>
<div class="thai-menu-list">
<?php foreach ($section['items'] as $item): ?>
<a class="thai-menu-item <?= Yii::$app->request->url == $item['link'] ? 'active' : '' ?>" href="<?= $item['link'] ?>">
<?= $item['icon'] ? Html::tag('i', '', ['class' => $item['icon']]) : '<i class="fa fa-chevron-right"></i>' ?>
<?= $item['name'] ?>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
2026-02-27 02:56:17 +00:00
<?php endforeach; ?>
2026-02-25 06:59:34 +00:00
2026-02-27 02:56:17 +00:00
<!-- Section: CMS Page 65 (Custom Description) - Keeping as static since it's a specific page injection -->
<div class="sidebar-section custom-cms-content">
<?php
$cms65 = CmsPage::findOne(65);
if ($cms65) echo $cms65->description;
?>
2026-02-25 06:59:34 +00:00
</div>
2026-02-27 02:56:17 +00:00
<!-- Section: ลิงค์สำคัญ / กราฟิก - Keeping static as these are specific image-based links -->
<div class="sidebar-section service-grid">
<a class="service-link" href="<?= Url::to(['post/view', 'id' => 731]) ?>" target="_blank">
<?= Html::img(Yii::getAlias('@web') . '/img/ita68.png', ['class' => 'img-fluid', 'alt' => 'ITA']) ?>
</a>
<a class="service-link" href="<?= Url::to(['page/view', 'id' => 63]) ?>" target="_blank">
<?= Html::img(Yii::getAlias('@web') . '/img/llpa68.png', ['class' => 'img-fluid', 'alt' => 'LPA']) ?>
</a>
<a class="service-link" href="https://webmail.kokjan.go.th" target="_blank">
<?= Html::img(Yii::getAlias('@web') . '/img/service-ico/email.png', ['class' => 'img-fluid', 'alt' => 'Email']) ?>
</a>
<a class="service-link" href="<?= Url::to(['file/index']) ?>" target="_blank">
<?= Html::img(Yii::getAlias('@web') . '/img/service-ico/e-service2.png', ['class' => 'img-fluid', 'alt' => 'e-Service']) ?>
</a>
<a class="service-link" href="<?= Url::to(['page/view', 'id' => 61]) ?>" target="_blank">
<?= Html::img(Yii::getAlias('@web') . '/img/service-ico/trophy.png', ['class' => 'img-fluid', 'alt' => 'รางวัล']) ?>
</a>
2026-02-25 06:59:34 +00:00
</div>
</div>