Test version
This commit is contained in:
@@ -1,84 +1,110 @@
|
||||
<?php $menu = array(
|
||||
"Radio" => array(
|
||||
"" => "/gids",
|
||||
"Luister live" => "/luister/live",
|
||||
"Kijk in de studio" => "/kijk/studio",
|
||||
"Regionieuws" => "/luister/regionieuws",
|
||||
"Programmagids" => "/gids",
|
||||
"Programma gemist" => "/gemist/programma",
|
||||
"Fragment gemist" => "/gemist/fragment"),
|
||||
// "Zondagsdienst" => "/kerkdienst"),
|
||||
"TV" => array(
|
||||
"Kijk live" => "/kijk/live" ),
|
||||
// "NHGOOI TV @ YouTube" => "https://www.youtube.com/channel/UC0qLwqmXiLoL5PrLlgB6B4Q"),
|
||||
//"Evenementen" => array(
|
||||
// "Debatten gemeenteraad" => "/debat"),
|
||||
// "24 uur Scherp de Zeis (4 december)" => "/programma/1030/scherp-zeis",
|
||||
// "Winterse 50 (25 december)" => "/programma/1080/winterse-50",
|
||||
// "Vroeger of Later Luisterlijst (2 januari)" => "/vol-luisterlijst"),
|
||||
"App" => "/app",
|
||||
"Podcast" => array(
|
||||
"Waterschapsverkiezing 2023" => "/gemist/fragment/1356528/podcast-waterschapsverkiezingen-2023.mp3",
|
||||
"NH Gooi Spreekuur" => "/podcast/1091/nh-gooi-spreekuur",
|
||||
"Duurzaam Gooi" => "/podcast/1076/podcast-duurzaam-gooi"
|
||||
),
|
||||
"Regioagenda" => "/agenda",
|
||||
"NH Gooi" => array(
|
||||
"" => "/contact",
|
||||
"Gooische courant" => array(
|
||||
"Editie 2" => "/uploads/Gooische Courant editie 2.pdf",
|
||||
"Editie 1(Huizen)" => "/uploads/NH Gooi Huizen.pdf",
|
||||
"Editie 1 (Hilversum)" => "/uploads/NH Gooi Hilversum.pdf",
|
||||
),
|
||||
"Contact" => "/contact",
|
||||
// "Vacatures" => "/vacatures",
|
||||
"Klachtenregeling" => "/klachten",
|
||||
"Uitgangspunten streekredactie" => "/uploads/Eigen rol en ambities NH Gooi binnen de lokale nieuwsvoorziening.pdf",
|
||||
"Frequenties" => "/frequenties",
|
||||
"Adverteren?" => "/adverteren",
|
||||
"NH Nieuws" => "https://nhnieuws.nl")
|
||||
"Radio" => array(
|
||||
"" => "/gids",
|
||||
"Luister live" => "/luister/live",
|
||||
"Kijk in de studio" => "/kijk/studio",
|
||||
"Regionieuws" => "/luister/regionieuws",
|
||||
"Programmagids" => "/gids",
|
||||
"Programma gemist" => "/gemist/programma",
|
||||
"Fragment gemist" => "/gemist/fragment"
|
||||
),
|
||||
// "Zondagsdienst" => "/kerkdienst"),
|
||||
"TV" => array(
|
||||
"Kijk live" => "/kijk/live"
|
||||
),
|
||||
// "NHGOOI TV @ YouTube" => "https://www.youtube.com/channel/UC0qLwqmXiLoL5PrLlgB6B4Q"),
|
||||
// "Evenementen" => array(
|
||||
// "Debatten gemeenteraad" => "/debat"),
|
||||
// "24 uur Scherp de Zeis (4 december)" => "/programma/1030/scherp-zeis",
|
||||
// "Winterse 50 (25 december)" => "/programma/1080/winterse-50",
|
||||
// "Vroeger of Later Luisterlijst (2 januari)" => "/vol-luisterlijst"),
|
||||
"App" => "/app",
|
||||
"Podcast" => array(
|
||||
"Waterschapsverkiezing 2023" => "/gemist/fragment/1356528/podcast-waterschapsverkiezingen-2023.mp3",
|
||||
"NH Gooi Spreekuur" => "/podcast/1091/nh-gooi-spreekuur",
|
||||
"Duurzaam Gooi" => "/podcast/1076/podcast-duurzaam-gooi"
|
||||
),
|
||||
"Regioagenda" => "/agenda",
|
||||
"NH Gooi" => array(
|
||||
"" => "/contact",
|
||||
"Gooische courant" => array(
|
||||
"Editie 2" => "/uploads/Gooische Courant editie 2.pdf",
|
||||
"Editie 1(Huizen)" => "/uploads/NH Gooi Huizen.pdf",
|
||||
"Editie 1 (Hilversum)" => "/uploads/NH Gooi Hilversum.pdf",
|
||||
),
|
||||
"Contact" => "/contact",
|
||||
// "Vacatures" => "/vacatures",
|
||||
"Klachtenregeling" => "/klachten",
|
||||
"Uitgangspunten streekredactie" => "/uploads/Eigen rol en ambities NH Gooi binnen de lokale nieuwsvoorziening.pdf",
|
||||
"Frequenties" => "/frequenties",
|
||||
"Adverteren?" => "/adverteren",
|
||||
"NH Nieuws" => "https://nhnieuws.nl"
|
||||
)
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
function isActive($link, $checksubmenus) {
|
||||
if(is_array($link)) {
|
||||
if(!$checksubmenus) { return false; }
|
||||
foreach($link as $item => $link) {
|
||||
if(isActive($link, $checksubmenus)) { return true; }
|
||||
function isActive($link, $checksubmenus)
|
||||
{
|
||||
if (is_array($link)) {
|
||||
if (!$checksubmenus) {
|
||||
return false;
|
||||
}
|
||||
foreach ($link as $item => $link) {
|
||||
if (isActive($link, $checksubmenus)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return (substr($_SERVER["REQUEST_URI"], 0, strlen($link)) == $link);
|
||||
return (substr($_SERVER["REQUEST_URI"], 0, strlen($link)) == $link);
|
||||
}
|
||||
|
||||
function buildMenu($menu, $ismobile) {
|
||||
function buildMenu($menu, $ismobile)
|
||||
{
|
||||
$result = "";
|
||||
foreach($menu as $title => $link) {
|
||||
if($title == "") { continue; }
|
||||
foreach ($menu as $title => $link) {
|
||||
if ($title == "") {
|
||||
continue;
|
||||
}
|
||||
$submenu = is_array($link);
|
||||
$isactive = isActive($link, !$ismobile);
|
||||
$icon = "";
|
||||
$isplayer = false;
|
||||
$liClass = "";
|
||||
if(!$submenu && substr($link, 0, 8) == '/luister') { $icon = "fas fa-headphones"; $isplayer = true; }
|
||||
if(!$submenu && $link == '/kijk/live') { $icon = "fas fa-tv"; }
|
||||
if(!$submenu && $link == '/kijk/studio') { $liClass = "watch-studio"; $icon = "fas fa-video"; }
|
||||
if(!$submenu && substr($link, 0, 23) == 'https://www.youtube.com') { $icon = "fab fa-youtube"; }
|
||||
if(!$submenu && substr($link, strlen($link) - 4, 4) == '.pdf') { $icon = "fas fa-file-pdf"; }
|
||||
$isactive = isActive($link, !$ismobile);
|
||||
$icon = "";
|
||||
$isplayer = false;
|
||||
$liClass = "";
|
||||
if (!$submenu && substr($link, 0, 8) == '/luister') {
|
||||
$icon = "fas fa-headphones";
|
||||
$isplayer = true;
|
||||
}
|
||||
if (!$submenu && $link == '/kijk/live') {
|
||||
$icon = "fas fa-tv";
|
||||
}
|
||||
if (!$submenu && $link == '/kijk/studio') {
|
||||
$liClass = "watch-studio";
|
||||
$icon = "fas fa-video";
|
||||
}
|
||||
if (!$submenu && substr($link, 0, 23) == 'https://www.youtube.com') {
|
||||
$icon = "fab fa-youtube";
|
||||
}
|
||||
if (!$submenu && substr($link, strlen($link) - 4, 4) == '.pdf') {
|
||||
$icon = "fas fa-file-pdf";
|
||||
}
|
||||
|
||||
$submenulink = $submenu && isset($link[""]) ? $link[""] : "#";
|
||||
$target = substr($submenu ? $submenulink : $link, 0, 4) == "http" ? "target='_blank'" : "";
|
||||
if($icon) { $icon = "<span class='$icon'></span> "; }
|
||||
else { $icon = ""; }
|
||||
if ($icon) {
|
||||
$icon = "<span class='$icon'></span> ";
|
||||
} else {
|
||||
$icon = "";
|
||||
}
|
||||
$result .=
|
||||
"<li class=\"" . ($submenu ? "submenu" : "") . ($isactive ? " selected" : "") . ($liClass ? " $liClass" : "") . "\">
|
||||
"<li class=\"" . ($submenu ? "submenu" : "") . ($isactive ? " selected" : "") . ($liClass ? " $liClass" : "") . "\">
|
||||
<a href=\"" . ($submenu ? $submenulink : $link) . "\" class=\"" . ($isplayer ? "player" : "") . "\" title=\"{$title}\" {$target}>{$icon}{$title}</a>";
|
||||
if($submenu) {
|
||||
if ($submenu) {
|
||||
$result .= "\t\t\t<ul>\n"
|
||||
. buildMenu($link, $ismobile)
|
||||
. "\t\t\t</ul>\n";
|
||||
. buildMenu($link, $ismobile)
|
||||
. "\t\t\t</ul>\n";
|
||||
}
|
||||
$result .= "\t\t</li>\n";
|
||||
}
|
||||
@@ -87,112 +113,120 @@ function buildMenu($menu, $ismobile) {
|
||||
}
|
||||
?>
|
||||
<nav>
|
||||
<ul class="sf-menu">
|
||||
@php($newsUrl = '/nieuws')
|
||||
@if($news)
|
||||
<li class="submenu mega_menu_parent {{isActive($newsUrl, false) ? "selected" : ""}}">
|
||||
<a href="{{$newsUrl}}" title="Nieuws">
|
||||
Nieuws
|
||||
</a>
|
||||
<ul>
|
||||
@if($activeBlog != null)
|
||||
<li class="{{isActive($activeBlog->url, false) ? "selected" : ""}}">
|
||||
<a href="{{url($activeBlog->url)}}" title="Liveblog: {{$activeBlog->title}}">
|
||||
<b>Live-blog</b> | {{$activeBlog->title}}
|
||||
<ul class="menu d-none d-lg-block">
|
||||
<li></li>
|
||||
@php($newsUrl = '/nieuws')
|
||||
@if($news)
|
||||
<li class="submenu mega_menu_parent {{isActive($newsUrl, false) ? "selected" : ""}}">
|
||||
<a href="{{$newsUrl}}" title="Nieuws">
|
||||
Nieuws
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li class="submenu">
|
||||
<a href="{{$newsUrl}}" title="Laatste nieuws">
|
||||
Laatste nieuws
|
||||
</a>
|
||||
<ul class="mega_menu blog">
|
||||
@foreach($news as $item)
|
||||
<li class="post">
|
||||
@if($item->images && count($item->images))
|
||||
<a href="{{url($item->url)}}" title="{{$item->title}}">
|
||||
<img src='{{$imgBase . $item->images[0]->url}}' alt='{{$item->title}}'>
|
||||
<ul>
|
||||
@if($activeBlog != null)
|
||||
<li class="{{isActive($activeBlog->url, false) ? "selected" : ""}}">
|
||||
<a href="{{url($activeBlog->url)}}" title="Liveblog: {{$activeBlog->title}}">
|
||||
<b>Live-blog</b> | {{$activeBlog->title}}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li class="submenu">
|
||||
<a href="{{$newsUrl}}" title="Laatste nieuws">
|
||||
Laatste nieuws
|
||||
</a>
|
||||
@endif
|
||||
<h5><a href="{{url($item->url)}}" title="{{$item->title}}">{{$item->title}}</a></h5>
|
||||
<ul class="post_details simple">
|
||||
@if($item->region)
|
||||
<li class="category">{{$item->region->title}}</li>
|
||||
@endif
|
||||
<li class="date">
|
||||
{{Formatter::relativeDate($item->published)}} om {{$item->published->format('H:i')}} uur
|
||||
</li>
|
||||
<ul class="mega_menu blog">
|
||||
@foreach($news as $item)
|
||||
<li class="post">
|
||||
@if($item->images && count($item->images))
|
||||
<a href="{{url($item->url)}}" title="{{$item->title}}">
|
||||
<img src='{{$imgBase . $item->images[0]->url}}' alt='{{$item->title}}'>
|
||||
</a>
|
||||
@endif
|
||||
<h5><a href="{{url($item->url)}}" title="{{$item->title}}">{{$item->title}}</a></h5>
|
||||
<ul class="post_details simple">
|
||||
@if($item->region)
|
||||
<li class="category">{{$item->region->title}}</li>
|
||||
@endif
|
||||
<li class="date">
|
||||
{{Formatter::relativeDate($item->published)}}
|
||||
om {{$item->published->format('H:i')}} uur
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
@endforeach
|
||||
@if($popular)
|
||||
<li class="submenu">
|
||||
<a href="{{$newsUrl}}" title="Meest gelezen">
|
||||
Meest gelezen
|
||||
</a>
|
||||
<ul class="mega_menu blog">
|
||||
@foreach($popular as $item)
|
||||
<li class="post">
|
||||
@if($item->images && count($item->images))
|
||||
<a href="{{url($item->url)}}" title="{{$item->title}}">
|
||||
<img src='{{$imgBase . $item->images[0]->url}}' alt='{{$item->title}}'>
|
||||
</a>
|
||||
@endif
|
||||
<h5><a href="{{url($item->url)}}" title="{{$item->title}}">{{$item->title}}</a>
|
||||
</h5>
|
||||
<ul class="post_details simple">
|
||||
@if($item->region)
|
||||
<li class="category">{{$item->region->title}}</li>
|
||||
@endif
|
||||
<li class="date">
|
||||
{{Formatter::relativeDate($item->published)}}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@if($podcasts)
|
||||
<li class="submenu">
|
||||
<a href="{{route('gemist')}}" title="Gesprek gemist">
|
||||
Fragment gemist
|
||||
</a>
|
||||
<ul class="mega_menu blog">
|
||||
@foreach($podcasts as $item)
|
||||
@if($loop->index >= 3)
|
||||
@break
|
||||
@endif
|
||||
<li class="post">
|
||||
@if($item->image)
|
||||
<a href="{{route('gemist.fragment') . $item->url}}" title="{{$item->title}}"
|
||||
class="fixed-height">
|
||||
<img src='{{$imgBase . $item->image->url}}' alt='{{$item->title}}'>
|
||||
</a>
|
||||
@endif
|
||||
<h5><a href="{{route('gemist.fragment') . $item->url}}"
|
||||
title="{{$item->title}}">{{$item->title}}</a></h5>
|
||||
<ul class="post_details simple">
|
||||
@if($item->program)
|
||||
<li class="category">{{$item->program->name}}</li>
|
||||
@endif
|
||||
<li class="date">
|
||||
{{Formatter::relativeDate($item->created)}}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</li>
|
||||
@if($popular)
|
||||
<li class="submenu">
|
||||
<a href="{{$newsUrl}}" title="Meest gelezen">
|
||||
Meest gelezen
|
||||
</a>
|
||||
<ul class="mega_menu blog">
|
||||
@foreach($popular as $item)
|
||||
<li class="post">
|
||||
@if($item->images && count($item->images))
|
||||
<a href="{{url($item->url)}}" title="{{$item->title}}">
|
||||
<img src='{{$imgBase . $item->images[0]->url}}' alt='{{$item->title}}'>
|
||||
</a>
|
||||
@endif
|
||||
<h5><a href="{{url($item->url)}}" title="{{$item->title}}">{{$item->title}}</a></h5>
|
||||
<ul class="post_details simple">
|
||||
@if($item->region)
|
||||
<li class="category">{{$item->region->title}}</li>
|
||||
@endif
|
||||
<li class="date">
|
||||
{{Formatter::relativeDate($item->published)}}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<li class="{{isActive($newsUrl, false) ? "selected" : ""}}">
|
||||
<a href="{{$newsUrl}}" title="Nieuws">Nieuws</a>
|
||||
</li>
|
||||
@endif
|
||||
@if($podcasts)
|
||||
<li class="submenu">
|
||||
<a href="{{route('gemist')}}" title="Gesprek gemist">
|
||||
Fragment gemist
|
||||
</a>
|
||||
<ul class="mega_menu blog">
|
||||
@foreach($podcasts as $item)
|
||||
@if($loop->index >= 3) @break @endif
|
||||
<li class="post">
|
||||
@if($item->image)
|
||||
<a href="{{route('gemist.fragment') . $item->url}}" title="{{$item->title}}" class="fixed-height">
|
||||
<img src='{{$imgBase . $item->image->url}}' alt='{{$item->title}}'>
|
||||
</a>
|
||||
@endif
|
||||
<h5><a href="{{route('gemist.fragment') . $item->url}}" title="{{$item->title}}">{{$item->title}}</a></h5>
|
||||
<ul class="post_details simple">
|
||||
@if($item->program)
|
||||
<li class="category">{{$item->program->name}}</li>
|
||||
@endif
|
||||
<li class="date">
|
||||
{{Formatter::relativeDate($item->created)}}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</li>
|
||||
@else
|
||||
<li class="{{isActive($newsUrl, false) ? "selected" : ""}}">
|
||||
<a href="{{$newsUrl}}" title="Nieuws">Nieuws</a>
|
||||
</li>
|
||||
@endif
|
||||
{!! buildMenu($menu, false) !!}
|
||||
</ul>
|
||||
@endif
|
||||
{!! buildMenu($menu, false) !!}
|
||||
<li></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="mobile_menu_container" >
|
||||
<div class="mobile_menu_container d-none d-sm-block d-md-none">
|
||||
<a href="#" class="mobile-menu-switch">
|
||||
<span class="line"></span>
|
||||
<span class="line"></span>
|
||||
@@ -200,20 +234,20 @@ function buildMenu($menu, $ismobile) {
|
||||
</a>
|
||||
<div class="mobile-menu-divider"></div>
|
||||
<nav>
|
||||
<ul class="mobile-menu">
|
||||
@if($activeBlog != null)
|
||||
<li class="{{isActive($activeBlog->url, false) ? "selected" : ""}}">
|
||||
<a href="{{url($activeBlog->url)}}" title="Liveblog: {{$activeBlog->title}}">
|
||||
<b>Live-blog</b> | {{$activeBlog->title}}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li class="submenu {{isActive($newsUrl, false) ? "selected" : ""}}">
|
||||
<a href="{{$newsUrl}}" title="Nieuws">
|
||||
Nieuws
|
||||
</a>
|
||||
</li>
|
||||
{!! buildMenu($menu, true) !!}
|
||||
<ul class="mobile-menu">
|
||||
@if($activeBlog != null)
|
||||
<li class="{{isActive($activeBlog->url, false) ? "selected" : ""}}">
|
||||
<a href="{{url($activeBlog->url)}}" title="Liveblog: {{$activeBlog->title}}">
|
||||
<b>Live-blog</b> | {{$activeBlog->title}}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li class="submenu {{isActive($newsUrl, false) ? "selected" : ""}}">
|
||||
<a href="{{$newsUrl}}" title="Nieuws">
|
||||
Nieuws
|
||||
</a>
|
||||
</li>
|
||||
{!! buildMenu($menu, true) !!}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user