Compare commits
134 Commits
fix-layout
...
8fab0d57a7
| Author | SHA1 | Date | |
|---|---|---|---|
| 8fab0d57a7 | |||
|
|
ae7ed5a217 | ||
| d492b36fec | |||
|
|
3b4030113b | ||
|
|
6786ac7ce1 | ||
|
|
b78379f268 | ||
|
|
733e18531f | ||
|
|
9f8f7a6a41 | ||
|
|
08e1551b3f | ||
|
|
b0ae121363 | ||
|
|
8c22515397 | ||
|
|
30bfd34ee3 | ||
|
|
d46dc081ef | ||
|
|
acc2260745 | ||
|
|
11e1a3ea54 | ||
|
|
643efdb404 | ||
|
|
e3564b524f | ||
|
|
7da73b92a9 | ||
|
|
d0190a7b35 | ||
|
|
2b5a905a2d | ||
|
|
e4d91c2af5 | ||
|
|
4f2c134b67 | ||
|
|
de39b84975 | ||
|
|
06b2bd704b | ||
|
|
f5b39618f6 | ||
|
|
12c498a125 | ||
|
|
c8fd7e8a51 | ||
|
|
144d0844e8 | ||
|
|
7a0f727c86 | ||
| b64defe7fc | |||
|
|
6333ff6433 | ||
| f28e1609ae | |||
|
|
99720de0ca | ||
| ee8d50cf6c | |||
|
|
ae0e83def6 | ||
|
|
68ae6f9161 | ||
| 47a7590bf5 | |||
|
|
863381a226 | ||
| 4bd72b1349 | |||
|
|
94eddea78b | ||
| 6abe7ba61a | |||
|
|
7f1688ee89 | ||
|
|
34f5cfca73 | ||
|
|
676569256e | ||
|
|
5cd69739e5 | ||
|
|
b24fdc8e41 | ||
|
|
e12fcf8ad7 | ||
|
|
5b4b0011ea | ||
|
|
5e3604da33 | ||
|
|
aec6690c9e | ||
|
|
3e7490531d | ||
|
|
c7243f31a0 | ||
|
|
2e1f496eea | ||
|
|
92c66e4ed9 | ||
|
|
37745e8ae9 | ||
|
|
eb9813c239 | ||
|
|
9dc9b30afa | ||
|
|
761cec4257 | ||
|
|
0e2148956f | ||
| 1863ff766f | |||
| 96748c0c01 | |||
| c16a2db01d | |||
| df4d48a327 | |||
| 187fc7b273 | |||
| 06e7741d3b | |||
| 262aec618b | |||
| 98a9cd2c53 | |||
| 21ca729958 | |||
| 367527098d | |||
| a86f8e56a1 | |||
| c1ddaa15c6 | |||
| 39f1ee4823 | |||
| 71a5d3a690 | |||
|
|
6db6de8e49 | ||
|
|
e06ce1507b | ||
| 3ef630c7cc | |||
| 2ba81f8550 | |||
| f3fa2c109a | |||
| 52df85716b | |||
| 22292e10ed | |||
| 9428e1d2ee | |||
| 1c587684f3 | |||
| 918255be1c | |||
|
|
35a5aa636f | ||
|
|
e2551b1dab | ||
|
|
552c638571 | ||
|
|
a930fb7216 | ||
|
|
58ea5c0c85 | ||
|
|
8616cb3d56 | ||
|
|
dbca7e2bc5 | ||
|
|
437e6243e7 | ||
|
|
9698f9b103 | ||
|
|
6008d3175b | ||
|
|
8d1e79f1b7 | ||
|
|
ab7246e123 | ||
|
|
d9627a54c4 | ||
|
|
6c732f90e8 | ||
|
|
1dadbc62af | ||
|
|
7f07a28b98 | ||
|
|
cff9948dda | ||
|
|
059b1ed47a | ||
|
|
0699269fb2 | ||
|
|
a3e8b05008 | ||
|
|
389e5c6523 | ||
| ba06608ee0 | |||
| 8da0481296 | |||
| 885ce2b2cc | |||
|
|
6d91e1d3ca | ||
|
|
5ebf7f20be | ||
|
|
cc1eba5959 | ||
|
|
3b55a1cf42 | ||
|
|
f4444d44e3 | ||
|
|
35713d2974 | ||
|
|
6044a670d7 | ||
|
|
173d9dcaf6 | ||
|
|
a7d1347319 | ||
|
|
92769463cd | ||
|
|
47eb0952d4 | ||
|
|
e7bae27951 | ||
|
|
50d6a97fce | ||
|
|
9d96efc022 | ||
|
|
539dd88d42 | ||
|
|
d9c933b79a | ||
|
|
84355b1121 | ||
|
|
e551e55158 | ||
|
|
2799b1843f | ||
|
|
52f38b4c00 | ||
|
|
e2f114a7a8 | ||
|
|
cc58f5931c | ||
|
|
23d88ac143 | ||
|
|
56adc60788 | ||
|
|
2db970e8c6 | ||
|
|
80256669b1 | ||
|
|
738107515c |
@@ -37,3 +37,7 @@ DB_PASSWORD=dbpass
|
|||||||
|
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
QUEUE_DRIVER=sync
|
QUEUE_DRIVER=sync
|
||||||
|
|
||||||
|
FRIENDLY_CAPTCHA_SITEKEY=
|
||||||
|
FRIENDLY_CAPTCHA_SECRET=
|
||||||
|
FRIENDLY_CAPTCHA_DEBUG=true
|
||||||
|
|||||||
2
Dockerfile
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
FROM php:8.1-apache
|
FROM php:8.2-apache
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install \
|
&& apt-get -y install \
|
||||||
|
|||||||
2
Dockerfile.dev
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
FROM php:8.1-apache
|
FROM php:8.2-apache
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install \
|
&& apt-get -y install \
|
||||||
|
|||||||
0
Gruntfile.js
vendored
Normal file → Executable file
0
app/Console/Kernel.php
Normal file → Executable file
0
app/Exceptions/Handler.php
Normal file → Executable file
0
app/Helpers/FormatterHelper.php
Normal file → Executable file
0
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file → Executable file
0
app/Http/Controllers/Auth/LoginController.php
Normal file → Executable file
0
app/Http/Controllers/Auth/RegisterController.php
Normal file → Executable file
0
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file → Executable file
55
app/Http/Controllers/CalendarController.php
Normal file → Executable file
@@ -6,69 +6,20 @@ use \Illuminate\Http\Request;
|
|||||||
|
|
||||||
class CalendarController extends Controller
|
class CalendarController extends Controller
|
||||||
{
|
{
|
||||||
private $events = [
|
|
||||||
1 => [
|
|
||||||
'id' => 1,
|
|
||||||
'title' => 'Seinconcert Hilversum',
|
|
||||||
'region' => 'Hilversum',
|
|
||||||
'content' => 'Vrijdag 19 april treedt het Barbican Quartet op in de serie Seinconcerten in Hilversum. Op het programma staan werken van Schubert, Ravel en Britten.',
|
|
||||||
'starts' => '16-04-2024',
|
|
||||||
'ends' => '19-04-2024',
|
|
||||||
'url' => 'seinconcert-hilversum',
|
|
||||||
'images' => [
|
|
||||||
['url' => '/img/news/rHjgm6CM0D.jpg']
|
|
||||||
]
|
|
||||||
],
|
|
||||||
2 => [
|
|
||||||
'id' => 2,
|
|
||||||
'title' => 'Orgelconcert Blaricum',
|
|
||||||
'region' => 'Blaricum',
|
|
||||||
'content' => '<p><strong>In april van dit jaar bestaat het Maarschalkerweerd orgel van de Vituskerk in Blaricum 150 jaar. Ter gelegenheid hiervan is er op zondag 21 april van 14.00 – 15.00 uur een orgelconcert in de Vituskerk. De vaste organisten van de Vituskerk, Bas Groenewoud en Herman van Dijk, zullen het orgel bespelen en er zal iets worden verteld over de geschiedenis van het orgel.</strong></p><p>Het orgel is in 1874 gebouw door Michaël Maarschalkerweerd. Hij bouwde orgels die in de traditie van de neogotiek passen en zijn orgels zijn zeer geschikt voor het spelen van 19e-eeuwse romantische werken. Het orgel in het Amsterdamse concertgebouw is ook van zijn hand. In zijn bedrijf werkten rond 1900 ruim twintig mensen. Na Michaels dood in 1915 werd het bedrijf voortgezet door C.H. van Brussel, J.J. Elbertse en L. Collard, die tot dan toe meesterknechten geweest waren. Elbertse verliet de firma na twee jaar om zijn eigen orgelmakerij op te richten. De firma Elbertse uit Soest heeft jarenlang dit orgel in onderhoud gehad (de tweede én derde generatie trad toe).</p><p>In 2023 fuseerde het bedrijf met de firma Van Vulpen. Het orgel in de Vituskerk was oorspronkelijk gebouwd op de koorzolder maar tijdens de grondige verbouwing van de kerk in 2004 werd het orgel naar beneden gehaald zodat het in al zijn pracht te bewonderen is en ook nodig is om dienst te doen als ondersteuning van het koor. Afgelopen jaar is het orgel in de Vituskerk grondig gerenoveerd.</p><p>Het concert begint om 14:00 uur en de entree is vrij. Collecte na afloop.</p>',
|
|
||||||
'starts' => '21-04-2024',
|
|
||||||
'ends' => '21-04-2024',
|
|
||||||
'url' => 'orgelconcert-blaricum',
|
|
||||||
'images' => [
|
|
||||||
['url' => '/img/news/tgrOh0kbIS.jpg']
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
$events = [];
|
|
||||||
foreach ($this->events as $index => $event) {
|
|
||||||
$object = new \stdClass();
|
|
||||||
foreach ($event as $key => $value) {
|
|
||||||
$object->$key = $value;
|
|
||||||
}
|
|
||||||
$events[$index] = $object;
|
|
||||||
}
|
|
||||||
$this->events = $events;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show(Request $request, $id)
|
public function show(Request $request, $id)
|
||||||
{
|
{
|
||||||
parent::registerView($request, 'agenda', $id);
|
parent::registerView($request, 'agenda', $id);
|
||||||
if ($id > 3) {
|
|
||||||
$apiResult = $this->API('agenda/item/' . (int)$id);
|
$apiResult = $this->API('agenda/item/' . (int)$id);
|
||||||
} else {
|
$calendarEvent = new \Model\CalendarEvent($apiResult->news);
|
||||||
$apiResult = $this->events[$id];
|
|
||||||
}
|
|
||||||
$calendarEvent = new \Model\CalendarEvent($apiResult);
|
|
||||||
|
|
||||||
return view('calendarevent', array_merge($this->getSidebareData(), ['event' => $calendarEvent, 'metadata' => $calendarEvent->metadata]));
|
return view('calendarevent', array_merge($this->getSidebareData(), ['event' => $calendarEvent, 'metadata' => $calendarEvent->metadata]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function overview(Request $request)
|
public function overview(Request $request)
|
||||||
{
|
{
|
||||||
$apiResult = $this->API('agenda/overzicht');
|
$apiResult = $this->API('agenda/overzicht?aantal=100');
|
||||||
if (!count($apiResult)) {
|
|
||||||
$apiResult = $this->events;
|
|
||||||
}
|
|
||||||
$calendar = [];
|
$calendar = [];
|
||||||
foreach($apiResult as $calendarItem)
|
foreach($apiResult->events as $calendarItem)
|
||||||
{
|
{
|
||||||
$calendar[] = new \Model\CalendarEvent($calendarItem);
|
$calendar[] = new \Model\CalendarEvent($calendarItem);
|
||||||
}
|
}
|
||||||
|
|||||||
74
app/Http/Controllers/ContactController.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
use App\Mail\ContactFormSubmitted;
|
||||||
|
|
||||||
|
class ContactController extends Controller
|
||||||
|
{
|
||||||
|
public function show()
|
||||||
|
{
|
||||||
|
return view('contact');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function submit(Request $request)
|
||||||
|
{
|
||||||
|
$rules = [
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
'email' => 'required|email|max:255',
|
||||||
|
'message' => 'required|string',
|
||||||
|
'image' => 'nullable|image|max:10240',
|
||||||
|
'video' => 'nullable|mimetypes:video/avi,video/mpeg,video/quicktime,video/mp4|max:512000',
|
||||||
|
];
|
||||||
|
|
||||||
|
$debugCaptcha = env('FRIENDLY_CAPTCHA_DEBUG', false)
|
||||||
|
|| (app()->environment('local')
|
||||||
|
&& (!env('FRIENDLY_CAPTCHA_SITEKEY') || !env('FRIENDLY_CAPTCHA_SECRET')));
|
||||||
|
|
||||||
|
if ($debugCaptcha) {
|
||||||
|
$rules['frc-captcha-solution'] = 'nullable';
|
||||||
|
} else {
|
||||||
|
$rules['frc-captcha-solution'] = ['required', Rule::friendlycaptcha()];
|
||||||
|
}
|
||||||
|
|
||||||
|
$request->validate($rules);
|
||||||
|
|
||||||
|
$data = $request->only(['name', 'email', 'message']);
|
||||||
|
$attachments = [];
|
||||||
|
|
||||||
|
// Handle Image
|
||||||
|
if ($request->hasFile('image')) {
|
||||||
|
// Store temporarily to attach
|
||||||
|
$imagePath = $request->file('image')->store('contact_images');
|
||||||
|
$attachments['image'] = storage_path('app/' . $imagePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle Video
|
||||||
|
if ($request->hasFile('video')) {
|
||||||
|
$videoPath = $request->file('video')->store('contact_videos', 'local');
|
||||||
|
$data['video_link'] = route('contact.video', ['filename' => basename($videoPath)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send Email
|
||||||
|
Mail::to('info@nhgooi.nl')->send(new ContactFormSubmitted($data, $attachments));
|
||||||
|
|
||||||
|
return redirect()->route('contact')->with('success', 'Bedankt voor uw bericht. We nemen zo snel mogelijk contact met u op.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function video(string $filename)
|
||||||
|
{
|
||||||
|
$path = 'contact_videos/' . basename($filename);
|
||||||
|
|
||||||
|
if (!Storage::disk('local')->exists($path)) {
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$fullPath = Storage::disk('local')->path($path);
|
||||||
|
|
||||||
|
return response()->file($fullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
92
app/Http/Controllers/Controller.php
Normal file → Executable file
@@ -19,9 +19,9 @@ class Controller extends BaseController
|
|||||||
|
|
||||||
private function getDataFromFileAndConvert($file, $path, $class, $maxItems = 0)
|
private function getDataFromFileAndConvert($file, $path, $class, $maxItems = 0)
|
||||||
{
|
{
|
||||||
$data = json_decode(Storage::disk('local')->get($file));
|
$data = json_decode(Storage::get($file));
|
||||||
foreach ($path as $subobject) {
|
foreach ($path as $subobject) {
|
||||||
$data = $data->$subobject;
|
$data = $data->$subobject ?? [];
|
||||||
}
|
}
|
||||||
$items = [];
|
$items = [];
|
||||||
foreach ($data as $item_data) {
|
foreach ($data as $item_data) {
|
||||||
@@ -39,39 +39,30 @@ class Controller extends BaseController
|
|||||||
View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/'));
|
View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/'));
|
||||||
View::share('imgBase', env('IMAGE_BASE_URL', '/'));
|
View::share('imgBase', env('IMAGE_BASE_URL', '/'));
|
||||||
|
|
||||||
$blogs = $this->getDataFromFileAndConvert('blogs.json', [], '\Model\Blog', 1);
|
|
||||||
$activeBlog = count($blogs) && $blogs[0]->is_active ? $blogs[0] : null;
|
|
||||||
View::share('activeBlog', $activeBlog);
|
|
||||||
|
|
||||||
|
|
||||||
//View::share('onAir', file_get_contents(url('onair')));
|
//View::share('onAir', file_get_contents(url('onair')));
|
||||||
View::composer('widgets.laatstenieuws', function ($view) {
|
View::composer('widgets.laatstenieuws', function ($view) {
|
||||||
$view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'));
|
$view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'));
|
||||||
});
|
});
|
||||||
View::composer('widgets.populairnieuws', function ($view) {
|
View::composer('widgets.populairnieuws', function ($view) {
|
||||||
$view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem'));
|
$view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem'));
|
||||||
});
|
});
|
||||||
View::composer('widgets.nustraks', function ($view) {
|
View::composer('widgets.nustraks', function ($view) {
|
||||||
$data = json_decode(Storage::disk('local')->get('nu_straks.json'))->schedule;
|
$data = json_decode(Storage::get('nu_straks.json'))->schedule;
|
||||||
$programs = [];
|
$programs = [];
|
||||||
foreach ($data as $item_data) {
|
foreach ($data as $item_data) {
|
||||||
$programs[] = $program = new \Model\Program($item_data->program);
|
$programs[] = $program = new \Model\Program($item_data->program);
|
||||||
$program->start = new \DateTimeImmutable($item_data->start->date,
|
$program->start = self::JsonToDateTime($item_data->start);
|
||||||
new \DateTimeZone($item_data->start->timezone));
|
$program->end = self::JsonToDateTime($item_data->end);
|
||||||
$program->end = new \DateTimeImmutable($item_data->end->date,
|
|
||||||
new \DateTimeZone($item_data->end->timezone));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need a bit of slack here, otherwise the current program may show up
|
// Need a bit of slack here, otherwise the current program may show up
|
||||||
$now = new \DateTimeImmutable('2 minutes ago');
|
$now = new \DateTimeImmutable('2 minutes ago');
|
||||||
$data = json_decode(Storage::disk('local')->get('zojuist.json'))->schedule;
|
$data = json_decode(Storage::get('zojuist.json'))->schedule;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach (array_reverse($data) as $item_data) {
|
foreach (array_reverse($data) as $item_data) {
|
||||||
$recent = $program = new \Model\Program($item_data->program);
|
$recent = $program = new \Model\Program($item_data->program);
|
||||||
$recent->start = new \DateTimeImmutable($item_data->start->date,
|
$recent->start = self::JsonToDateTime($item_data->start);
|
||||||
new \DateTimeZone($item_data->start->timezone));
|
$recent->end = self::JsonToDateTime($item_data->end);
|
||||||
$recent->end = new \DateTimeImmutable($item_data->end->date,
|
|
||||||
new \DateTimeZone($item_data->end->timezone));
|
|
||||||
if (($recent->end < $now) && (!$recent->nonstop) && (!$recent->rerun)) {
|
if (($recent->end < $now) && (!$recent->nonstop) && (!$recent->rerun)) {
|
||||||
$view->with('recent', $recent);
|
$view->with('recent', $recent);
|
||||||
break;
|
break;
|
||||||
@@ -81,8 +72,10 @@ class Controller extends BaseController
|
|||||||
$view->with('data', $programs);
|
$view->with('data', $programs);
|
||||||
});
|
});
|
||||||
View::composer('widgets.laatstepodcasts', function ($view) {
|
View::composer('widgets.laatstepodcasts', function ($view) {
|
||||||
$view->with('data',
|
$view->with(
|
||||||
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
|
'data',
|
||||||
|
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')
|
||||||
|
);
|
||||||
});
|
});
|
||||||
View::composer('widgets.regioagenda', function ($view) {
|
View::composer('widgets.regioagenda', function ($view) {
|
||||||
$view->with('data', $this->getDataFromFileAndConvert('regioagenda.json', [], '\Model\CalendarEvent'));
|
$view->with('data', $this->getDataFromFileAndConvert('regioagenda.json', [], '\Model\CalendarEvent'));
|
||||||
@@ -92,12 +85,17 @@ class Controller extends BaseController
|
|||||||
});
|
});
|
||||||
View::composer('widgets.menu', function ($view) {
|
View::composer('widgets.menu', function ($view) {
|
||||||
$view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'))
|
$view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'))
|
||||||
->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem', 3))
|
->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem', 3))
|
||||||
->with('podcasts',
|
->with(
|
||||||
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
|
'podcasts',
|
||||||
|
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
View::composer('widgets.menu', function($view) {
|
||||||
|
$view->with('items', json_decode(Storage::get('static/menu.json')));
|
||||||
});
|
});
|
||||||
|
|
||||||
View::share('disableBanners', env('DISABLE_BANNERS', true));
|
View::share('disableBanners', env('DISABLE_BANNERS', false));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function registerView(Request $request, $type, $id)
|
protected function registerView(Request $request, $type, $id)
|
||||||
@@ -106,31 +104,34 @@ class Controller extends BaseController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
app('db')->insert('INSERT INTO `pagestats`(`type`, `item_id`, `visitor_ip`, `session`, `referer`) VALUES(:type, :id, :ip, :session, :referer)',
|
app('db')->insert(
|
||||||
|
'INSERT INTO `pagestats`(`type`, `item_id`, `visitor_ip`, `session`, `referer`) VALUES(:type, :id, :ip, :session, :referer)',
|
||||||
[
|
[
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'ip' => $request->server('REMOTE_ADDR'),
|
'ip' => $request->server('REMOTE_ADDR'),
|
||||||
'session' => md5(Session::getId()),
|
'session' => md5(Session::getId()),
|
||||||
'referer' => $request->server('HTTP_REFERRER')
|
'referer' => $request->server('HTTP_REFERRER')
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function API($url)
|
protected function API($url)
|
||||||
{
|
{
|
||||||
// if (strpos($url, 'nieuws/overzicht') !== false) {
|
|
||||||
// return json_decode(file_get_contents(__DIR__ . '/../../../storage/app/laatste_nieuws.json'));
|
|
||||||
// }
|
|
||||||
// return [];
|
|
||||||
|
|
||||||
$arrContextOptions = [
|
$arrContextOptions = [
|
||||||
'ssl' => [
|
'ssl' => [
|
||||||
"verify_peer" => false,
|
"verify_peer" => false,
|
||||||
"verify_peer_name" => false,
|
"verify_peer_name" => false,
|
||||||
],
|
],
|
||||||
|
'http' => [
|
||||||
|
'method' => 'GET',
|
||||||
|
'header' => 'X-Api-Key: ' . sha1(request()->server('REMOTE_ADDR')) . "\r\n"
|
||||||
|
. 'X-User-Agent: ' . request()->server('HTTP_USER_AGENT') . "\r\n"
|
||||||
|
]
|
||||||
];
|
];
|
||||||
|
//\dump($http_response_header);
|
||||||
return json_decode(file_get_contents($this->API_URL . $url, false, stream_context_create($arrContextOptions)));
|
$result = @file_get_contents($this->API_URL . $url, false, stream_context_create($arrContextOptions));
|
||||||
|
return $result ? json_decode($result) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkAPI($url)
|
protected function checkAPI($url)
|
||||||
@@ -148,9 +149,10 @@ class Controller extends BaseController
|
|||||||
|
|
||||||
protected static function JsonToDateTime($obj)
|
protected static function JsonToDateTime($obj)
|
||||||
{
|
{
|
||||||
return new \DateTime($obj->date, new \DateTimeZone($obj->timezone));
|
return is_object($obj) ? new \DateTime($obj->date, new \DateTimeZone($obj->timezone)) : \Carbon\Carbon::parse($obj)->setTimezone(date_default_timezone_get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public function __call($method, $arguments)
|
public function __call($method, $arguments)
|
||||||
{
|
{
|
||||||
if (substr($method, 0, 5) == 'view_') {
|
if (substr($method, 0, 5) == 'view_') {
|
||||||
@@ -162,12 +164,13 @@ class Controller extends BaseController
|
|||||||
|
|
||||||
return abort(404);
|
return abort(404);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public function getSidebareData()
|
public function getSidebareData()
|
||||||
{
|
{
|
||||||
$populair = [];
|
$populair = [];
|
||||||
$apiResult = $this->API('nieuws/populair?aantal=5');
|
$apiResult = $this->API('nieuws/populair?aantal=5');
|
||||||
foreach ($apiResult as $_newsItem) {
|
foreach ($apiResult->news as $_newsItem) {
|
||||||
$populair[] = new \Model\NewsItem($_newsItem);
|
$populair[] = new \Model\NewsItem($_newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,4 +182,23 @@ class Controller extends BaseController
|
|||||||
|
|
||||||
return ['newsItems' => $newsItems, 'populair' => $populair];
|
return ['newsItems' => $newsItems, 'populair' => $populair];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function static_page($slug)
|
||||||
|
{
|
||||||
|
if (view()->exists($slug)) {
|
||||||
|
return view($slug);
|
||||||
|
}
|
||||||
|
|
||||||
|
$page = $this->API('statisch/' . $slug);
|
||||||
|
if ($page == null) {
|
||||||
|
return abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$page->published = Controller::JsonToDateTime($page->published);
|
||||||
|
if ($page->edited) {
|
||||||
|
$page->edited = Controller::JsonToDateTime($page->edited);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('static', compact('page'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
app/Http/Controllers/HomeController.php
Normal file → Executable file
@@ -9,26 +9,25 @@ class HomeController extends Controller
|
|||||||
{
|
{
|
||||||
public function show(Request $request)
|
public function show(Request $request)
|
||||||
{
|
{
|
||||||
$page = (int)$request->get('pagina', 1);
|
$page = (int) $request->get('pagina', 1);
|
||||||
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int)max(1, $page) . '&aantal=10');
|
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int) max(1, $page) . '&aantal=10');
|
||||||
$news = [];
|
$news = [];
|
||||||
foreach ($apiResult->news as $newsItem) {
|
foreach ($apiResult->news as $newsItem) {
|
||||||
$news[] = new \Model\NewsItem($newsItem);
|
$news[] = new \Model\NewsItem($newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$apiResult = $this->API('nieuws/liveblogs');
|
||||||
|
$liveblogs = $apiResult->liveblogs;
|
||||||
|
|
||||||
$populair = [];
|
$populair = [];
|
||||||
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5');
|
$apiResult = $this->API('nieuws/populair?pagina=' . (int) max(1, $page) . '&aantal=5');
|
||||||
foreach ($apiResult as $newsItem) {
|
foreach ($apiResult->news as $newsItem) {
|
||||||
$populair[] = new \Model\NewsItem($newsItem);
|
$populair[] = new \Model\NewsItem($newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
$podcasts = [];
|
$apiResult = $this->API('podcast/overzicht?aantal=15');
|
||||||
$apiResult = $this->API('podcast/overzicht?aantal=3');
|
$index = array_rand($apiResult->podcasts);
|
||||||
$podcast = new \Model\Podcast($apiResult->podcasts[0]);
|
$podcast = new \Model\Podcast($apiResult->podcasts[$index]);
|
||||||
foreach ($apiResult->podcasts as $_podcast) {
|
return view('home', ['populair' => $populair, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'liveblogs' => $liveblogs, 'searchURL' => 'nieuws/zoeken']);
|
||||||
$podcasts[] = new \Model\Podcast($_podcast);
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('home', ['populair' => $populair, 'podcasts' => $podcasts, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
app/Http/Controllers/ImagesController.php
Normal file → Executable file
10
app/Http/Controllers/JobsController.php
Normal file → Executable file
@@ -29,12 +29,12 @@ class JobsController extends Controller
|
|||||||
private function listJobs(Request $request, $url, $title = null)
|
private function listJobs(Request $request, $url, $title = null)
|
||||||
{
|
{
|
||||||
$page = (int)$request->get('pagina', 1);
|
$page = (int)$request->get('pagina', 1);
|
||||||
$apiResult = $this->API('vacatures/' . $url . '?pagina=' . (int)max(1, $page));
|
#$apiResult = $this->API('vacatures/' . $url . '?pagina=' . (int)max(1, $page));
|
||||||
$jobs = [];
|
$jobs = [];
|
||||||
foreach($apiResult->jobs as $jobsItem)
|
#foreach($apiResult->jobs as $jobsItem)
|
||||||
{
|
#{
|
||||||
$jobs[] = new \Model\JobOpening($jobsItem);
|
# $jobs[] = new \Model\JobOpening($jobsItem);
|
||||||
}
|
#}
|
||||||
|
|
||||||
return view('jobslist', array_merge($this->getSidebareData(), ['title' => $title, 'jobs' => $jobs]));
|
return view('jobslist', array_merge($this->getSidebareData(), ['title' => $title, 'jobs' => $jobs]));
|
||||||
//return view($request->ajax() ? 'partial/jobslist_small' : ($title == null ? 'home' : 'jobslist'), ['title' => $title, 'jobs' => $jobs, 'searchURL' => 'vacatures/zoeken']);
|
//return view($request->ajax() ? 'partial/jobslist_small' : ($title == null ? 'home' : 'jobslist'), ['title' => $title, 'jobs' => $jobs, 'searchURL' => 'vacatures/zoeken']);
|
||||||
|
|||||||
0
app/Http/Controllers/KerkdienstController.php
Normal file → Executable file
93
app/Http/Controllers/NewsController.php
Normal file → Executable file
@@ -17,27 +17,31 @@ class NewsController extends Controller
|
|||||||
public function show(Request $request, $id)
|
public function show(Request $request, $id)
|
||||||
{
|
{
|
||||||
parent::registerView($request, 'nieuws', $id);
|
parent::registerView($request, 'nieuws', $id);
|
||||||
$apiResult = $this->API('nieuws/bericht/' . $id);
|
$preview = "";
|
||||||
|
if (request()->get('preview', null) != null) {
|
||||||
|
$preview = "?preview=" . request()->get('preview');
|
||||||
|
}
|
||||||
|
$apiResult = $this->API('nieuws/bericht/' . $id . $preview);
|
||||||
$newsItem = new \Model\NewsItem($apiResult->news);
|
$newsItem = new \Model\NewsItem($apiResult->news);
|
||||||
|
|
||||||
switch ($apiResult->version) {
|
switch ($apiResult->version) {
|
||||||
case 1:
|
case 1:
|
||||||
if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi');
|
if (!$newsItem->content)
|
||||||
return view('newsitem', ['news' => $newsItem, 'metadata' => $newsItem->metadata]);
|
return redirect('//nhnieuws.nl/gooi');
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
$source = $apiResult->source;
|
if (isset($apiResult->source->article)) {
|
||||||
|
$source = $apiResult->source->article;
|
||||||
$newsItem->published = self::TimestampToDateTime($source->created);
|
$newsItem->published = self::TimestampToDateTime($source->created);
|
||||||
$newsItem->edited = self::TimestampToDateTime($source->updated);
|
$newsItem->edited = self::TimestampToDateTime($source->updated);
|
||||||
$newsItem->author = $source->author;
|
$newsItem->author = $source->author;
|
||||||
$newsItem->images = null; // Images will be embedded
|
$newsItem->images = null; // Images will be embedded
|
||||||
$newsItem->video = null; // Videos will be embedded
|
$newsItem->video = null; // Videos will be embedded
|
||||||
$newsItem->content = $source->blocks;
|
$newsItem->content = $source->blocks;
|
||||||
|
} elseif (isset($apiResult->source->blocks)) {
|
||||||
|
$newsItem->content = $apiResult->source->blocks;
|
||||||
|
}
|
||||||
return view('newsitem', array_merge($this->getSidebareData(), ['news' => $newsItem, 'metadata' => $newsItem->metadata, 'searchURL' => 'nieuws/zoeken']));
|
return view('newsitem', array_merge($this->getSidebareData(), ['type' => $apiResult->type, 'news' => $newsItem, 'metadata' => $newsItem->metadata, 'searchURL' => 'nieuws/zoeken']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,9 +52,9 @@ class NewsController extends Controller
|
|||||||
|
|
||||||
public function more(Request $request)
|
public function more(Request $request)
|
||||||
{
|
{
|
||||||
$page = (int)$request->get('pagina', 1);
|
$page = (int) $request->get('pagina', 1);
|
||||||
$id = $request->get('id', '');
|
$id = $request->get('id', '');
|
||||||
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int)max(1, $page) . '&aantal=5');
|
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int) max(1, $page) . '&aantal=5');
|
||||||
$news = [];
|
$news = [];
|
||||||
foreach ($apiResult->news as $newsItem) {
|
foreach ($apiResult->news as $newsItem) {
|
||||||
$news[] = new \Model\NewsItem($newsItem);
|
$news[] = new \Model\NewsItem($newsItem);
|
||||||
@@ -61,25 +65,30 @@ class NewsController extends Controller
|
|||||||
|
|
||||||
public function populair(Request $request)
|
public function populair(Request $request)
|
||||||
{
|
{
|
||||||
$page = (int)$request->get('pagina', 1);
|
$page = (int) $request->get('pagina', 1);
|
||||||
$id = $request->get('id', '');
|
$id = $request->get('id', '');
|
||||||
$populair = [];
|
$populair = [];
|
||||||
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5');
|
$apiResult = $this->API('nieuws/populair?pagina=' . (int) max(1, $page) . '&aantal=5');
|
||||||
foreach ($apiResult as $_newsItem) {
|
foreach ($apiResult->news as $_newsItem) {
|
||||||
$populair[] = new \Model\NewsItem($_newsItem);
|
$populair[] = new \Model\NewsItem($_newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('partial/newslist_small', ['id' => $id, 'news' => $populair]);
|
return view('partial/newslist_small', ['id' => $id, 'news' => $populair]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function taglist(Request $request, $tag)
|
||||||
|
{
|
||||||
|
return $this->listNews($request, 'tag/' . $tag, ucfirst($tag));
|
||||||
|
}
|
||||||
|
|
||||||
public function regionlist(Request $request, $region)
|
public function regionlist(Request $request, $region)
|
||||||
{
|
{
|
||||||
return $this->listNews($request, 'regio/' . $region, ucfirst($region));
|
return $this->listNews($request, 'tag/' . $region, ucfirst($region));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function themelist(Request $request, $theme)
|
public function themelist(Request $request, $theme)
|
||||||
{
|
{
|
||||||
return $this->listNews($request, 'thema/' . $theme, ucfirst($theme));
|
return $this->listNews($request, 'tag/' . $theme, ucfirst($theme));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function search(Request $request, $query)
|
public function search(Request $request, $query)
|
||||||
@@ -101,30 +110,25 @@ class NewsController extends Controller
|
|||||||
return abort(404);
|
return abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function blog(Request $request, $id)
|
public function liveblog(Request $request, $id)
|
||||||
{
|
{
|
||||||
|
|
||||||
parent::registerView($request, 'blog', $id);
|
parent::registerView($request, 'blog', $id);
|
||||||
|
|
||||||
$page = (int)$request->get('pagina', 1);
|
$blog = $this->API('nieuws/liveblog/' . (int) $id);
|
||||||
$hasNext = true;
|
foreach ($blog->artikelen as &$item) {
|
||||||
while ($page > 0) {
|
$item = new \Model\NewsItem($item);
|
||||||
$apiResult = $this->API('blog/overzicht/' . (int)$id . '?pagina=' . (int)max(1, $page));
|
|
||||||
|
|
||||||
$blog = new \Model\Blog($apiResult->blog);
|
|
||||||
$items = [];
|
|
||||||
foreach ($apiResult->items as $blogItem) {
|
|
||||||
$items[] = new \Model\NewsItem($blogItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($items) || ($page == 1)) {
|
if (request()->ajax()) {
|
||||||
return view('blog', ['blog' => $blog, 'pagina' => $page, 'items' => $items, 'hasNext' => $hasNext && count($items) == 15]);
|
return $blog;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hasNext = false;
|
if (count($blog->artikelen)) {
|
||||||
--$page;
|
return view('blog', ['blog' => $blog]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return abort(404);
|
return abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function listNews(Request $request, $url, $title = null, $id = 'items', $total = null)
|
private function listNews(Request $request, $url, $title = null, $id = 'items', $total = null)
|
||||||
@@ -132,10 +136,13 @@ class NewsController extends Controller
|
|||||||
if ($request->ajax()) {
|
if ($request->ajax()) {
|
||||||
$total = 5;
|
$total = 5;
|
||||||
}
|
}
|
||||||
$page = (int)$request->get('pagina', 1);
|
$page = (int) $request->get('pagina', 1);
|
||||||
$apiResult = $this->API('nieuws/' . $url . '?pagina=' . (int)max(1, $page) . ($total ? '&aantal=' . $total : ''));
|
if ($url == 'overzicht' && $request->get('dateStart', null) && $request->get('dateEnd', null)) {
|
||||||
|
$url = 'datum/' . $request->get('dateStart', null) . '/' . $request->get('dateEnd', null);
|
||||||
|
}
|
||||||
|
$apiResult = $this->API('nieuws/' . $url . '?pagina=' . (int) max(1, $page) . ($total ? '&aantal=' . $total : ''));
|
||||||
$news = [];
|
$news = [];
|
||||||
foreach ($apiResult->news as $newsItem) {
|
foreach ($apiResult->news ?? [] as $newsItem) {
|
||||||
$news[] = new \Model\NewsItem($newsItem);
|
$news[] = new \Model\NewsItem($newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,9 +150,11 @@ class NewsController extends Controller
|
|||||||
if ($title == null) {
|
if ($title == null) {
|
||||||
$total = 5;
|
$total = 5;
|
||||||
}
|
}
|
||||||
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1,
|
$apiResult = $this->API('nieuws/populair?pagina=' . (int) max(
|
||||||
$page) . ($total ? '&aantal=' . $total : ''));
|
1,
|
||||||
foreach ($apiResult as $newsItem) {
|
$page
|
||||||
|
) . ($total ? '&aantal=' . $total : ''));
|
||||||
|
foreach ($apiResult->news as $newsItem) {
|
||||||
$populair[] = new \Model\NewsItem($newsItem);
|
$populair[] = new \Model\NewsItem($newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +181,7 @@ class NewsController extends Controller
|
|||||||
{
|
{
|
||||||
$apiResult = $this->API('nieuws/populair');
|
$apiResult = $this->API('nieuws/populair');
|
||||||
$news = [];
|
$news = [];
|
||||||
foreach ($apiResult as $newsItem) {
|
foreach ($apiResult->news as $newsItem) {
|
||||||
$news[] = new \Model\NewsItem($newsItem);
|
$news[] = new \Model\NewsItem($newsItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,11 +190,15 @@ class NewsController extends Controller
|
|||||||
|
|
||||||
public function regionieuws()
|
public function regionieuws()
|
||||||
{
|
{
|
||||||
|
$data = $this->API('nieuws/regionieuws.json');
|
||||||
return view('listen', [
|
return view('listen', [
|
||||||
'source' => $this->API_URL . 'nieuws/regionieuws',
|
'source' => $this->API_URL . 'nieuws/regionieuws.mp3',
|
||||||
'title' => 'Regionieuws',
|
'title' => 'Regionieuws',
|
||||||
'content' => 'het laatste nieuws uit de regio',
|
'content' => 'het laatste nieuws uit de regio',
|
||||||
'isStream' => false,
|
'isStream' => false,
|
||||||
'canDownload' => true]);
|
'canDownload' => true,
|
||||||
|
'lengte' => $data->length * 0.25,
|
||||||
|
'waveform' => $data
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
app/Http/Controllers/PodcastController.php
Normal file → Executable file
@@ -29,7 +29,7 @@ class PodcastController extends Controller
|
|||||||
$podcasts[] = new \Model\Podcast($podcast);
|
$podcasts[] = new \Model\Podcast($podcast);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view($request->ajax() ? 'partial.podcastitems' : 'podcastseries', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
|
return view($request->ajax() ? 'partial.podcastitems' : 'podcastseries', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => true]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function podcast(Request $request, $id)
|
public function podcast(Request $request, $id)
|
||||||
@@ -37,6 +37,15 @@ class PodcastController extends Controller
|
|||||||
parent::registerView($request, 'podcast', $id);
|
parent::registerView($request, 'podcast', $id);
|
||||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||||
$podcast = new \Model\Podcast($apiResult);
|
$podcast = new \Model\Podcast($apiResult);
|
||||||
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata]);
|
$podcasts = [];
|
||||||
|
if($podcast->program) {
|
||||||
|
$apiResult = $this->API('podcast/programma/' . (int)$podcast->program->id . '?pagina=1&aantal=5');
|
||||||
|
$podcasts = [];
|
||||||
|
foreach($apiResult->podcasts as $p)
|
||||||
|
{
|
||||||
|
$podcasts[] = new \Model\Podcast($p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'isPodcast' => true]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
app/Http/Controllers/RadioController.php
Normal file → Executable file
@@ -50,13 +50,16 @@ class RadioController extends Controller
|
|||||||
public function program($id)
|
public function program($id)
|
||||||
{
|
{
|
||||||
$apiResult = $this->API('programma/details/' . (int)$id);
|
$apiResult = $this->API('programma/details/' . (int)$id);
|
||||||
|
if($apiResult == null) {
|
||||||
|
return abort(404);
|
||||||
|
}
|
||||||
return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
|
return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function podcast(Request $request, $id, $title = '')
|
public function podcast(Request $request, $id, $title = '')
|
||||||
{
|
{
|
||||||
if($this->checkAPI('podcast/details/' . (int)$id) != "200"){
|
if($this->checkAPI('podcast/details/' . (int)$id) != "200"){
|
||||||
return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => null, 'metadata' => null, 'related' => [], 'searchURL' => 'gemist/zoeken']));
|
return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => null, 'metadata' => null, 'related' => [], 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::registerView($request, 'podcast', $id);
|
parent::registerView($request, 'podcast', $id);
|
||||||
@@ -71,7 +74,7 @@ class RadioController extends Controller
|
|||||||
$podcasts[] = new \Model\Podcast($_podcast);
|
$podcasts[] = new \Model\Podcast($_podcast);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view($request->ajax() ? 'partial/podcastitems' : 'podcastitem', ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']);
|
return view($request->ajax() ? 'partial/podcastitems' : 'podcastitem', ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function podcasts(Request $request, $programma = null)
|
public function podcasts(Request $request, $programma = null)
|
||||||
@@ -107,7 +110,7 @@ class RadioController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs)]);
|
return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs), 'isPodcast' => false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getPodcastList(Request $request, $action, $viewData = [])
|
private function getPodcastList(Request $request, $action, $viewData = [])
|
||||||
@@ -120,7 +123,7 @@ class RadioController extends Controller
|
|||||||
$podcasts[] = new \Model\Podcast($podcast);
|
$podcasts[] = new \Model\Podcast($podcast);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
|
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
0
app/Http/Controllers/SpecialController.php
Normal file → Executable file
34
app/Http/Controllers/StreamController.php
Normal file → Executable file
@@ -14,6 +14,8 @@ class StreamController extends Controller
|
|||||||
return view('listen', [
|
return view('listen', [
|
||||||
'source' => self::$STREAM_URL . 'mp3live',
|
'source' => self::$STREAM_URL . 'mp3live',
|
||||||
'title' => 'Luister live',
|
'title' => 'Luister live',
|
||||||
|
'lengte' => 0,
|
||||||
|
'waveform' => null,
|
||||||
'content' => 'de live-uitzending van NH Gooi.',
|
'content' => 'de live-uitzending van NH Gooi.',
|
||||||
'isStream' => true ]);
|
'isStream' => true ]);
|
||||||
}
|
}
|
||||||
@@ -30,6 +32,17 @@ class StreamController extends Controller
|
|||||||
return view('watch', ['title' => 'Kijk NH Gooi Tv Studio', 'stream' => 'https://studiocam.nhgooi.nl/studiocam/live/index.m3u8']);
|
return view('watch', ['title' => 'Kijk NH Gooi Tv Studio', 'stream' => 'https://studiocam.nhgooi.nl/studiocam/live/index.m3u8']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function inline(Request $request, $id)
|
||||||
|
{
|
||||||
|
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||||
|
$podcast = new \Model\Podcast($apiResult);
|
||||||
|
if(sha1($id . ':' . date('Y-m-d')) != $request->get('auth')) {
|
||||||
|
// return view('widgets/podcastplayer', ['podcast' => null]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('widgets/podcastplayer', ['podcast' => $podcast]);
|
||||||
|
}
|
||||||
|
|
||||||
public function podcast(Request $request, $id)
|
public function podcast(Request $request, $id)
|
||||||
{
|
{
|
||||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||||
@@ -39,17 +52,24 @@ class StreamController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return view('listen', [
|
return view('listen', [
|
||||||
'source' => $this->API_URL . 'podcast/download' . $apiResult->url . '?auth=' . $podcast->auth,
|
'source' => $this->API_URL . 'podcast/stream/' . $apiResult->url,
|
||||||
'title' => $podcast->title,
|
'title' => $podcast->title,
|
||||||
'content' => $podcast->title,
|
'content' => $podcast->title,
|
||||||
|
'lengte' => $podcast->duration / 1000,
|
||||||
|
'waveform' => $podcast->waveform,
|
||||||
'isStream' => false,
|
'isStream' => false,
|
||||||
'canDownload' => true ]);
|
'canDownload' => $this->API_URL . 'podcast/download/' . $apiResult->url ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function program(Request $request, $year, $month, $day, $hour, $duration, $offset = 0) {
|
public function program(Request $request, $year, $month, $day, $hour, $duration, $offset = 0) {
|
||||||
$date = (new \DateTimeImmutable())->setDate($year, $month, $day)->setTime($hour, 0, 0);
|
$date = (new \DateTimeImmutable())->setDate($year, $month, $day)->setTime($hour, 0, 0);
|
||||||
$current = $date->add(\DateInterval::createFromDateString($offset . ' hours'));
|
$current = $date->add(\DateInterval::createFromDateString($offset . ' hours'));
|
||||||
|
|
||||||
|
$programma = $this->API("programma/details/" . $current->Format("Y/m/d/H"));
|
||||||
|
if(!$programma->is_beschikbaar) {
|
||||||
|
return view('listen', ['notAvailable' => true]);
|
||||||
|
}
|
||||||
|
|
||||||
$hours = [];
|
$hours = [];
|
||||||
for($i = 0; $i < $duration; $i++) {
|
for($i = 0; $i < $duration; $i++) {
|
||||||
$other = $date->add(\DateInterval::createFromDateString($i . ' hours'));
|
$other = $date->add(\DateInterval::createFromDateString($i . ' hours'));
|
||||||
@@ -58,10 +78,12 @@ class StreamController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return view('listen', [
|
return view('listen', [
|
||||||
'source' => $this->API_URL . 'programma/download/' . $current->format('Y/m/d/H') . '/1',
|
'source' => $this->API_URL . 'programma/stream/' . $current->format('Y/m/d/H'),
|
||||||
'tabs' => $hours,
|
'tabs' => $hours,
|
||||||
'title' => 'Uitzending terugluisteren',
|
'title' => 'Uitzending terugluisteren',
|
||||||
'content' => 'de uitzending van ' . $current->format('d-m-Y, H') . ':00 uur',
|
'lengte' => $programma->waveform->length,
|
||||||
|
'waveform' => $programma->waveform,
|
||||||
|
'content' => $programma->programma->name . ' van ' . $current->format('d-m-Y, H') . ':00 uur',
|
||||||
'isStream' => false,
|
'isStream' => false,
|
||||||
'canDownload' => false ]);
|
'canDownload' => false ]);
|
||||||
}
|
}
|
||||||
@@ -77,10 +99,10 @@ class StreamController extends Controller
|
|||||||
|
|
||||||
public function kerkdienst(Request $request) {
|
public function kerkdienst(Request $request) {
|
||||||
return view('listen', [
|
return view('listen', [
|
||||||
'source' => $this->API_URL . 'kerkdienst/download',
|
'source' => $this->API_URL . 'kerkdienst/stream',
|
||||||
'title' => 'Kerkdienst gemist',
|
'title' => 'Kerkdienst gemist',
|
||||||
'content' => 'de kerkdienst van afgelopen zondag',
|
'content' => 'de kerkdienst van afgelopen zondag',
|
||||||
'isStream' => false,
|
'isStream' => false,
|
||||||
'canDownload' => true ]);
|
'canDownload' => $this->API_URL . 'kerkdienst/download' ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
app/Http/Kernel.php
Normal file → Executable file
0
app/Http/Middleware/EncryptCookies.php
Normal file → Executable file
0
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file → Executable file
0
app/Http/Middleware/TrimStrings.php
Normal file → Executable file
0
app/Http/Middleware/VerifyCsrfToken.php
Normal file → Executable file
45
app/Mail/ContactFormSubmitted.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Mail;
|
||||||
|
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Mail\Mailable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
|
||||||
|
class ContactFormSubmitted extends Mailable
|
||||||
|
{
|
||||||
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
|
public $data;
|
||||||
|
public $attachments_files;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new message instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct($data, $attachments_files = [])
|
||||||
|
{
|
||||||
|
$this->data = $data;
|
||||||
|
$this->attachments_files = $attachments_files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the message.
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function build()
|
||||||
|
{
|
||||||
|
$email = $this->view('emails.contact_submitted')
|
||||||
|
->subject('Nieuw contactformulier bericht van NH Gooi')
|
||||||
|
->replyTo($this->data['email'], $this->data['name']);
|
||||||
|
|
||||||
|
if (isset($this->attachments_files['image'])) {
|
||||||
|
$email->attach($this->attachments_files['image']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $email;
|
||||||
|
}
|
||||||
|
}
|
||||||
23
app/Models/Blog.php
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class Blog extends Model {
|
||||||
|
public $id;
|
||||||
|
public $title;
|
||||||
|
public $description;
|
||||||
|
public $news_category;
|
||||||
|
public $start_date;
|
||||||
|
public $end_date;
|
||||||
|
public $is_active;
|
||||||
|
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($data, $images = null, $podcast = null) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->start_date);
|
||||||
|
parent::ConvertToDateTime($this->end_date);
|
||||||
|
|
||||||
|
$this->url = "/blog/{$this->id}/" . parent::url_slug($this->title);
|
||||||
|
}
|
||||||
|
}
|
||||||
67
app/Models/CalendarEvent.php
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class CalendarEvent extends Model {
|
||||||
|
public $id;
|
||||||
|
public $title;
|
||||||
|
public $region;
|
||||||
|
public $content;
|
||||||
|
public $starts;
|
||||||
|
public $ends;
|
||||||
|
public $images;
|
||||||
|
public $podcast;
|
||||||
|
public $video;
|
||||||
|
public $keywords;
|
||||||
|
public $url;
|
||||||
|
public $metadata;
|
||||||
|
public $tags;
|
||||||
|
|
||||||
|
public function __construct($data, $images = null, $podcast = null) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->starts);
|
||||||
|
parent::ConvertToDateTime($this->ends);
|
||||||
|
|
||||||
|
$this->keywords = null;
|
||||||
|
if(isset($data->keywords)) {
|
||||||
|
if(is_array($data->keywords)) {
|
||||||
|
$this->keywords = $data->keywords;
|
||||||
|
} else if(trim($data->keywords)) {
|
||||||
|
$this->keywords = explode(' ', $data->keywords);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($podcast)
|
||||||
|
{
|
||||||
|
$this->podcast = new \Model\Podcast($podcast);
|
||||||
|
} else if(isset($data->podcast) && $data->podcast) {
|
||||||
|
$this->podcast = new \Model\Podcast($data->podcast);
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = ($images != null) ? $images
|
||||||
|
: (isset($data->images) ? $data->images : null);
|
||||||
|
if($images) {
|
||||||
|
$this->images = [];
|
||||||
|
foreach($images as $image) {
|
||||||
|
$this->images[] = new NewsImage($image, '/img/news/');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->url = "/agenda/{$this->id}/" . parent::url_slug($this->title);
|
||||||
|
$this->metadata = (new MetaData())
|
||||||
|
->set('title', $this->title)
|
||||||
|
->set('description', strip_tags($this->excerpt()))
|
||||||
|
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
|
||||||
|
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function excerpt() {
|
||||||
|
$hasImages = isset($this->images) && count($this->images) > 0;
|
||||||
|
$maxLength = $hasImages ? 200 : 500;
|
||||||
|
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
|
||||||
|
substr($this->content, 0, $maxLength) .
|
||||||
|
(strlen($this->content) > $maxLength ? '...' : '') .
|
||||||
|
'</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
61
app/Models/JobOpening.php
Executable file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class JobOpening extends Model {
|
||||||
|
public $id;
|
||||||
|
public $title;
|
||||||
|
public $content;
|
||||||
|
public $starts;
|
||||||
|
public $ends;
|
||||||
|
public $images;
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($data, $images = null, $podcast = null) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->starts);
|
||||||
|
parent::ConvertToDateTime($this->ends);
|
||||||
|
|
||||||
|
$this->keywords = null;
|
||||||
|
if(isset($data->keywords)) {
|
||||||
|
if(is_array($data->keywords)) {
|
||||||
|
$this->keywords = $data->keywords;
|
||||||
|
} else if(trim($data->keywords)) {
|
||||||
|
$this->keywords = explode(' ', $data->keywords);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($podcast)
|
||||||
|
{
|
||||||
|
$this->podcast = new \Model\Podcast($podcast);
|
||||||
|
} else if(isset($data->podcast) && $data->podcast) {
|
||||||
|
$this->podcast = new \Model\Podcast($data->podcast);
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = ($images != null) ? $images
|
||||||
|
: (isset($data->images) ? $data->images : null);
|
||||||
|
if($images) {
|
||||||
|
$this->images = [];
|
||||||
|
foreach($images as $image) {
|
||||||
|
$this->images[] = new NewsImage($image, '/img/news/');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->url = "/vacatures/{$this->id}/" . parent::url_slug($this->title);
|
||||||
|
$this->metadata = (new MetaData())
|
||||||
|
->set('title', $this->title)
|
||||||
|
->set('description', strip_tags($this->excerpt()))
|
||||||
|
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
|
||||||
|
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function excerpt() {
|
||||||
|
$hasImages = count($this->images) > 0;
|
||||||
|
$maxLength = $hasImages ? 200 : 500;
|
||||||
|
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
|
||||||
|
substr($this->content, 0, $maxLength) .
|
||||||
|
(strlen($this->content) > $maxLength ? '...' : '') .
|
||||||
|
'</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
26
app/Models/Kerkdienst.php
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class KerkdienstInstance extends Model {
|
||||||
|
public $name;
|
||||||
|
public $start;
|
||||||
|
|
||||||
|
public function __construct($data) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->start);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Kerkdienst extends Model {
|
||||||
|
public $isRunning;
|
||||||
|
public $previous;
|
||||||
|
public $next;
|
||||||
|
|
||||||
|
public function __construct($data) {
|
||||||
|
// parent::__construct($data);
|
||||||
|
$this->isRunning = $data->isRunning;
|
||||||
|
$this->previous = new KerkdienstInstance($data->previous);
|
||||||
|
$this->next = new KerkdienstInstance($data->next);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
app/Models/MetaData.php
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class MetaData {
|
||||||
|
private $data = ['type' => 'article', 'locale' => 'nl-nl'];
|
||||||
|
|
||||||
|
public function set($prop, $val) {
|
||||||
|
if($val) {
|
||||||
|
$this->data[$prop] = $val;
|
||||||
|
}
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function append($prop, $val) {
|
||||||
|
if(array_key_exists($prop, $this->data)) {
|
||||||
|
$this->data[$prop] .= $val;
|
||||||
|
}
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function prepend($prop, $val) {
|
||||||
|
if(array_key_exists($prop, $this->data)) {
|
||||||
|
$this->data[$prop] = $val . $this->data[$prop];
|
||||||
|
}
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function metaTags() {
|
||||||
|
foreach($this->data as $prop => $val) {
|
||||||
|
if($val) {
|
||||||
|
echo "<meta property=\"og:$prop\" content=\"" . htmlentities($val) . "\" />\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
64
app/Models/Model.php
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class Model {
|
||||||
|
protected function ConvertToDateTime(&$field) {
|
||||||
|
if($field) {
|
||||||
|
// PHP7 JSON-encodes to {date: "", "timezone_type": ..., "timezone": "UTC" }
|
||||||
|
// In that case $field will be an object
|
||||||
|
if(is_object($field)) {
|
||||||
|
$field = ($field->timezone)
|
||||||
|
? new \DateTimeImmutable($field->date, new \DateTimeZone($field->timezone))
|
||||||
|
: (new \DateTimeImmutable($field->date));
|
||||||
|
} else {
|
||||||
|
// If $field is not an object, assume it's a plain, valid, string
|
||||||
|
$field = new \DateTime($field);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($field === false || $field->getTimestamp() <= 0) {
|
||||||
|
// If field had data but is invalid DateTime or is 0000-00-00 00:00, set it to null.
|
||||||
|
$field = null;
|
||||||
|
} else {
|
||||||
|
// If valid, return local timezone
|
||||||
|
$field->setTimezone(new \DateTimeZone("Europe/Amsterdam"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct($data) {
|
||||||
|
$class = get_class($this);
|
||||||
|
foreach($data as $key => $val) {
|
||||||
|
if(property_exists($class, $key)) {
|
||||||
|
$this->$key = is_string($val) ? stripslashes($val) : $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function url_slug($text) {
|
||||||
|
// Alles naar kleine letter
|
||||||
|
$text = strtolower($text);
|
||||||
|
|
||||||
|
// Vervang accent-tekens door niet-geaccentueerde versies
|
||||||
|
// $text = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $text);
|
||||||
|
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
|
||||||
|
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
|
||||||
|
$text = str_replace($search, $replace, $text);
|
||||||
|
|
||||||
|
// Verwijder alle woorden van 3 letters, behalve BEL (BEL-combinatie etc)
|
||||||
|
if(strlen($text) > 3) {
|
||||||
|
$text = preg_replace('/\b(?!bel|fm|nh)([a-z]{1,3})\b/u', '', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vervang alles dat niet een woord-karakter is (letter, cijfer), een streepje of spatie
|
||||||
|
if(strlen($text) > 3) {
|
||||||
|
$text = preg_replace('/[^\w_\-\s]/', '', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reeksen van één of meer spaties / streepjes vervangen door een enkel streepje
|
||||||
|
$text = preg_replace('/[\-\s]+/', '-', $text);
|
||||||
|
|
||||||
|
// Verwijder alle witruimte / streepjes aan begin en eind
|
||||||
|
return trim(strtolower($text), '-');
|
||||||
|
}
|
||||||
|
}
|
||||||
20
app/Models/NewsImage.php
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class NewsImage extends Model {
|
||||||
|
public $id;
|
||||||
|
public $title;
|
||||||
|
public $author;
|
||||||
|
public $url;
|
||||||
|
|
||||||
|
public function __construct($data, $urlPrefix = '/') {
|
||||||
|
parent::__construct($data);
|
||||||
|
|
||||||
|
// Deserialisatie van JSON heeft url in data,
|
||||||
|
// lezen uit database heeft file en (als het goed is) urlPrefix
|
||||||
|
if(isset($data->file)) {
|
||||||
|
$this->url = $urlPrefix . $data->file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
118
app/Models/NewsItem.php
Executable file
@@ -0,0 +1,118 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
require_once "NewsImage.php";
|
||||||
|
require_once "NewsSource.php";
|
||||||
|
require_once "MetaData.php";
|
||||||
|
|
||||||
|
class NewsItem extends Model {
|
||||||
|
public $id;
|
||||||
|
public $title;
|
||||||
|
public $author;
|
||||||
|
public $content;
|
||||||
|
public $published;
|
||||||
|
public $edited;
|
||||||
|
public $keywords;
|
||||||
|
|
||||||
|
public $source;
|
||||||
|
public $category;
|
||||||
|
public $theme;
|
||||||
|
public $region;
|
||||||
|
public $tags;
|
||||||
|
|
||||||
|
public $podcast;
|
||||||
|
public $images;
|
||||||
|
public $video;
|
||||||
|
public $type;
|
||||||
|
public $url;
|
||||||
|
public $metadata;
|
||||||
|
|
||||||
|
public function __construct($data, $images = null, $podcast = null) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->published);
|
||||||
|
parent::ConvertToDateTime($this->edited);
|
||||||
|
|
||||||
|
if($this->edited && ($this->edited->getTimestamp() - $this->published->getTimestamp() < 1800 /* == 30 minutes */)) {
|
||||||
|
// If last edit was within grace period, consider it unedited (note: currently RES always saves edited == published on creation)
|
||||||
|
$this->edited = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->source = null;
|
||||||
|
if(isset($data->source))
|
||||||
|
{
|
||||||
|
if(is_object($data->source))
|
||||||
|
{
|
||||||
|
$this->source = new \Model\NewsSource($data->source->title, $data->source->url, $data->source->show);
|
||||||
|
} else if($data->source) {
|
||||||
|
$this->source = new \Model\NewsSource($data->source, $data->source_url, $data->showsource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($podcast) {
|
||||||
|
$this->podcast = new \Model\Podcast($podcast);
|
||||||
|
} else if(isset($data->podcast) && $data->podcast) {
|
||||||
|
$this->podcast = new \Model\Podcast($data->podcast);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->keywords = null;
|
||||||
|
if(isset($data->keywords)) {
|
||||||
|
if(is_array($data->keywords) || is_object($data->keywords)) {
|
||||||
|
$this->keywords = $data->keywords;
|
||||||
|
} else if(trim($data->keywords)) {
|
||||||
|
$this->keywords = explode(' ', $data->keywords);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->region)) {
|
||||||
|
if(is_object($data->region)) {
|
||||||
|
$this->region = new \Model\NewsRegion($data->region->title, $data->region->slug);
|
||||||
|
} else {
|
||||||
|
$this->region = new \Model\NewsRegion($data->region, $data->region_slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->theme)) {
|
||||||
|
if(is_object($data->theme)) {
|
||||||
|
$this->theme = new \Model\NewsRegion($data->theme->title, $data->theme->slug);
|
||||||
|
} else {
|
||||||
|
$this->theme = new \Model\NewsRegion($data->theme, $data->theme_slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->tags)) {
|
||||||
|
foreach($data->tags as $tag) {
|
||||||
|
$this->theme = new \Model\NewsRegion($tag->titel, $tag->slug);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = ($images != null) ? $images
|
||||||
|
: (isset($data->images) ? $data->images : null);
|
||||||
|
if($images) {
|
||||||
|
$this->images = [];
|
||||||
|
foreach($images as $image) {
|
||||||
|
$this->images[] = new NewsImage($image, '/img/news/');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->url = "/nieuws/{$this->id}/" . parent::url_slug($this->title);
|
||||||
|
$this->metadata = (new MetaData())
|
||||||
|
->set('title', $this->title)
|
||||||
|
->set('description', strip_tags($this->excerpt()))
|
||||||
|
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
|
||||||
|
->set('video', isset($this->video) ? $this->video : null)
|
||||||
|
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
|
||||||
|
->set('article:published_time', $this->published->format('r'))
|
||||||
|
->set('article:modified_time', $this->edited ? $this->edited->format('r') : null)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function excerpt() {
|
||||||
|
$hasImages = isset($this->images) && count($this->images) > 0;
|
||||||
|
$maxLength = $hasImages ? 200 : 500;
|
||||||
|
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
|
||||||
|
substr($this->content, 0, $maxLength) .
|
||||||
|
(strlen($this->content) > $maxLength ? '...' : '') .
|
||||||
|
'</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Models/NewsSource.php
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class NewsRegion {
|
||||||
|
public $title;
|
||||||
|
public $slug;
|
||||||
|
|
||||||
|
public function __construct($title, $slug = null) {
|
||||||
|
$this->title = $title;
|
||||||
|
$this->slug = $slug ? $slug : strtolower(str_replace(' ', '', $title));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NewsSource {
|
||||||
|
public $title;
|
||||||
|
public $url;
|
||||||
|
public $show;
|
||||||
|
|
||||||
|
public function __construct($title, $url, $show) {
|
||||||
|
$this->title = $title;
|
||||||
|
$this->url = $url;
|
||||||
|
$this->show = $show;
|
||||||
|
}
|
||||||
|
}
|
||||||
94
app/Models/Podcast.php
Executable file
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
require_once "NewsImage.php";
|
||||||
|
|
||||||
|
class Podcast extends Model {
|
||||||
|
public $id;
|
||||||
|
public $title;
|
||||||
|
public $content;
|
||||||
|
protected $soundfilename;
|
||||||
|
public $created;
|
||||||
|
public $program;
|
||||||
|
public $url;
|
||||||
|
public $auth;
|
||||||
|
public $download;
|
||||||
|
public $duration;
|
||||||
|
public $image;
|
||||||
|
public $metadata;
|
||||||
|
public $waveform;
|
||||||
|
private $key;
|
||||||
|
|
||||||
|
public function __construct($data) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->created);
|
||||||
|
|
||||||
|
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title) . '.mp3';
|
||||||
|
if($this->soundfilename) {
|
||||||
|
// Only generate when not constructing from a JSON object
|
||||||
|
$this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename);
|
||||||
|
$this->auth = $this->key;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->program)) {
|
||||||
|
$this->program = null;
|
||||||
|
if(is_object($data->program)) {
|
||||||
|
$this->program = new \Model\Program($data->program);
|
||||||
|
} elseif($data->program) {
|
||||||
|
$this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->imagefile)) {
|
||||||
|
$imagedata = new \stdClass();
|
||||||
|
$imagedata->id = $this->id;
|
||||||
|
$imagedata->file = $data->imagefile;
|
||||||
|
$imagedata->title = $data->imagecaption;
|
||||||
|
$this->image = new NewsImage($imagedata, '/img/podcast/');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->metadata, $data->metadata->waveform)){
|
||||||
|
$this->waveform = $data->metadata->waveform;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->metadata = (new MetaData())
|
||||||
|
->set('title', $this->title)
|
||||||
|
->set('description', strip_tags($this->excerpt()))
|
||||||
|
->set('image', isset($this->image) ? $this->image->url : null )
|
||||||
|
->set('audio', $this->url)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function titleWithoutProgram() {
|
||||||
|
if(!$this->program) { return $this->title; }
|
||||||
|
return trim(str_replace($this->program->name, '', $this->title), "- \t\n\r\0\x0B");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isValidAuth($key) {
|
||||||
|
return ($key == $this->key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSoundfile() {
|
||||||
|
return '/var/audio/podcast/' . $this->soundfilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function formatDuration() {
|
||||||
|
$seconds = $this->duration / 1000;
|
||||||
|
$milliseconds = $this->duration % 1000;
|
||||||
|
|
||||||
|
$hours = ($seconds > 3600) ? floor($seconds / 3600) : 0;
|
||||||
|
$seconds %= 3600;
|
||||||
|
return str_pad($hours, 2, '0', STR_PAD_LEFT)
|
||||||
|
. gmdate(':i:s', $seconds)
|
||||||
|
;//. ($milliseconds ? ".$milliseconds" : '') ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function excerpt() {
|
||||||
|
$maxLength = 500;
|
||||||
|
return '<p class="news-excerpt long">' .
|
||||||
|
substr($this->content, 0, $maxLength) .
|
||||||
|
(strlen($this->content) > $maxLength ? '...' : '') .
|
||||||
|
'</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
55
app/Models/Program.php
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class Program extends Model {
|
||||||
|
public $id;
|
||||||
|
public $name;
|
||||||
|
public $tagline;
|
||||||
|
public $description;
|
||||||
|
public $email;
|
||||||
|
public $nonstop;
|
||||||
|
public $rerun;
|
||||||
|
public $priority;
|
||||||
|
public $image;
|
||||||
|
|
||||||
|
public $hosts;
|
||||||
|
public $recent;
|
||||||
|
public $next;
|
||||||
|
|
||||||
|
public function __construct($data) {
|
||||||
|
parent::__construct($data);
|
||||||
|
|
||||||
|
if(isset($data->suffix) && $data->suffix) {
|
||||||
|
$this->name .= ' ' . $data->suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->recent && $this->recent) {
|
||||||
|
foreach($this->recent as &$recent) {
|
||||||
|
parent::ConvertToDateTime($recent->starts);
|
||||||
|
parent::ConvertToDateTime($recent->ends);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($this->next && $this->next) {
|
||||||
|
foreach($this->next as &$next) {
|
||||||
|
parent::ConvertToDateTime($next->starts);
|
||||||
|
parent::ConvertToDateTime($next->ends);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->email) && ($mailComma = strpos($data->email, ',')) !== false) {
|
||||||
|
$this->email = substr($data->email, 0, $mailComma);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data->state)) {
|
||||||
|
$this->nonstop = $data->state == 0;
|
||||||
|
$this->rerun = $data->state == 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->url = "/{$this->id}/" . parent::url_slug($this->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isSpecial() {
|
||||||
|
return ($this->priority < 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
10
app/Models/ProgramHost.php
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class ProgramHost extends Model {
|
||||||
|
public $id;
|
||||||
|
public $name;
|
||||||
|
public $email;
|
||||||
|
}
|
||||||
|
|
||||||
47
app/Models/Track.php
Executable file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Model;
|
||||||
|
|
||||||
|
class Track extends Model {
|
||||||
|
public $start;
|
||||||
|
public $itemCode;
|
||||||
|
public $title;
|
||||||
|
public $artist;
|
||||||
|
public $duration;
|
||||||
|
public $ends;
|
||||||
|
public $isLayout;
|
||||||
|
|
||||||
|
public function __construct($data) {
|
||||||
|
parent::__construct($data);
|
||||||
|
parent::ConvertToDateTime($this->start);
|
||||||
|
parent::ConvertToDateTime($this->ends);
|
||||||
|
$isLayout = $this->isLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static $IDENTS = ['UURSLUITER' => 'Nieuws', 'NIEUWSOPEN ' => 'Nieuws', 'ANWB' => 'Verkeersinformatie', 'REGIO' => 'Regionieuws', 'CB' => 'Reclame'];
|
||||||
|
|
||||||
|
public function isLayout() {
|
||||||
|
foreach(self::$IDENTS as $ident => $display) {
|
||||||
|
if(substr($this->itemCode, 0, strlen($ident)) == $ident || substr($this->title, 0, strlen($ident)) == $ident) {
|
||||||
|
$this->title = $display;
|
||||||
|
$this->artist = "";
|
||||||
|
$this->itemCode = '_' . $this->itemCode;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strlen($this->itemCode) > 0 && ($this->itemCode[0] == 'V')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ends($ends = null) {
|
||||||
|
$this->ends = $ends;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function secondsRemaining() {
|
||||||
|
return ($this->ends) ? ($this->ends->getTimestamp() - time()) : -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
6
app/Providers/AppServiceProvider.php
Normal file → Executable file
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
use Ossycodes\FriendlyCaptcha\Rules\FriendlyCaptcha as FriendlyCaptchaRule;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -14,6 +16,10 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
\Illuminate\Support\Facades\URL::forceScheme('https');
|
\Illuminate\Support\Facades\URL::forceScheme('https');
|
||||||
|
|
||||||
|
Rule::macro('friendlycaptcha', function () {
|
||||||
|
return app(FriendlyCaptchaRule::class);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
0
app/Providers/AuthServiceProvider.php
Normal file → Executable file
0
app/Providers/BroadcastServiceProvider.php
Normal file → Executable file
0
app/Providers/EventServiceProvider.php
Normal file → Executable file
0
app/Providers/RouteServiceProvider.php
Normal file → Executable file
0
app/User.php
Normal file → Executable file
0
bootstrap/app.php
Normal file → Executable file
0
bootstrap/autoload.php
Normal file → Executable file
0
bootstrap/cache/.gitignore
vendored
Normal file → Executable file
11
bootstrap/cache/packages.php
vendored
@@ -53,6 +53,17 @@
|
|||||||
0 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
0 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
'ossycodes/friendlycaptcha' =>
|
||||||
|
array (
|
||||||
|
'aliases' =>
|
||||||
|
array (
|
||||||
|
'FriendlyCaptcha' => 'Ossycodes\\FriendlyCaptcha\\Facades\\FriendlyCaptcha',
|
||||||
|
),
|
||||||
|
'providers' =>
|
||||||
|
array (
|
||||||
|
0 => 'Ossycodes\\FriendlyCaptcha\\FriendlyCaptchaServiceProvider',
|
||||||
|
),
|
||||||
|
),
|
||||||
'spatie/laravel-ignition' =>
|
'spatie/laravel-ignition' =>
|
||||||
array (
|
array (
|
||||||
'providers' =>
|
'providers' =>
|
||||||
|
|||||||
26
bootstrap/cache/services.php
vendored
@@ -30,13 +30,14 @@
|
|||||||
26 => 'Carbon\\Laravel\\ServiceProvider',
|
26 => 'Carbon\\Laravel\\ServiceProvider',
|
||||||
27 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
27 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
||||||
28 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
28 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||||
29 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
29 => 'Ossycodes\\FriendlyCaptcha\\FriendlyCaptchaServiceProvider',
|
||||||
30 => 'Collective\\Html\\HtmlServiceProvider',
|
30 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
||||||
31 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
31 => 'Collective\\Html\\HtmlServiceProvider',
|
||||||
32 => 'App\\Providers\\AppServiceProvider',
|
32 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
||||||
33 => 'App\\Providers\\AuthServiceProvider',
|
33 => 'App\\Providers\\AppServiceProvider',
|
||||||
34 => 'App\\Providers\\EventServiceProvider',
|
34 => 'App\\Providers\\AuthServiceProvider',
|
||||||
35 => 'App\\Providers\\RouteServiceProvider',
|
35 => 'App\\Providers\\EventServiceProvider',
|
||||||
|
36 => 'App\\Providers\\RouteServiceProvider',
|
||||||
),
|
),
|
||||||
'eager' =>
|
'eager' =>
|
||||||
array (
|
array (
|
||||||
@@ -54,11 +55,12 @@
|
|||||||
11 => 'Carbon\\Laravel\\ServiceProvider',
|
11 => 'Carbon\\Laravel\\ServiceProvider',
|
||||||
12 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
12 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
||||||
13 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
13 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||||
14 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
14 => 'Ossycodes\\FriendlyCaptcha\\FriendlyCaptchaServiceProvider',
|
||||||
15 => 'App\\Providers\\AppServiceProvider',
|
15 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
||||||
16 => 'App\\Providers\\AuthServiceProvider',
|
16 => 'App\\Providers\\AppServiceProvider',
|
||||||
17 => 'App\\Providers\\EventServiceProvider',
|
17 => 'App\\Providers\\AuthServiceProvider',
|
||||||
18 => 'App\\Providers\\RouteServiceProvider',
|
18 => 'App\\Providers\\EventServiceProvider',
|
||||||
|
19 => 'App\\Providers\\RouteServiceProvider',
|
||||||
),
|
),
|
||||||
'deferred' =>
|
'deferred' =>
|
||||||
array (
|
array (
|
||||||
|
|||||||
5
composer.json
Normal file → Executable file
@@ -10,7 +10,8 @@
|
|||||||
"laravel/framework": "^9.19",
|
"laravel/framework": "^9.19",
|
||||||
"laravel/sanctum": "^3.0",
|
"laravel/sanctum": "^3.0",
|
||||||
"laravel/tinker": "^2.7",
|
"laravel/tinker": "^2.7",
|
||||||
"laravelcollective/html": "^6.3"
|
"laravelcollective/html": "^6.3",
|
||||||
|
"ossycodes/friendlycaptcha": "^3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.9.1",
|
"fakerphp/faker": "^1.9.1",
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
"Database\\Factories\\": "database/factories/",
|
"Database\\Factories\\": "database/factories/",
|
||||||
"Database\\Seeders\\": "database/seeders/",
|
"Database\\Seeders\\": "database/seeders/",
|
||||||
"Helpers\\": "app/Helpers",
|
"Helpers\\": "app/Helpers",
|
||||||
"Model\\": "/srv/api/common/classes"
|
"Model\\": "app/Models"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
|
|||||||
132
composer.lock
generated
Normal file → Executable file
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "f70c81adf2990f185a8632535bd08631",
|
"content-hash": "f9a3eebc09010b2b187541a3e59a0eff",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
@@ -1934,34 +1934,37 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nette/schema",
|
"name": "nette/schema",
|
||||||
"version": "v1.2.3",
|
"version": "v1.3.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nette/schema.git",
|
"url": "https://github.com/nette/schema.git",
|
||||||
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f"
|
"reference": "2befc2f42d7c715fd9d95efc31b1081e5d765004"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
|
"url": "https://api.github.com/repos/nette/schema/zipball/2befc2f42d7c715fd9d95efc31b1081e5d765004",
|
||||||
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
|
"reference": "2befc2f42d7c715fd9d95efc31b1081e5d765004",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
|
"nette/utils": "^4.0",
|
||||||
"php": ">=7.1 <8.3"
|
"php": "8.1 - 8.5"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"nette/tester": "^2.3 || ^2.4",
|
"nette/tester": "^2.5.2",
|
||||||
"phpstan/phpstan-nette": "^1.0",
|
"phpstan/phpstan-nette": "^2.0@stable",
|
||||||
"tracy/tracy": "^2.7"
|
"tracy/tracy": "^2.8"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.2-dev"
|
"dev-master": "1.3-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Nette\\": "src"
|
||||||
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"src/"
|
"src/"
|
||||||
]
|
]
|
||||||
@@ -1990,34 +1993,36 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nette/schema/issues",
|
"issues": "https://github.com/nette/schema/issues",
|
||||||
"source": "https://github.com/nette/schema/tree/v1.2.3"
|
"source": "https://github.com/nette/schema/tree/v1.3.3"
|
||||||
},
|
},
|
||||||
"time": "2022-10-13T01:24:26+00:00"
|
"time": "2025-10-30T22:57:59+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nette/utils",
|
"name": "nette/utils",
|
||||||
"version": "v3.2.8",
|
"version": "v4.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nette/utils.git",
|
"url": "https://github.com/nette/utils.git",
|
||||||
"reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368"
|
"reference": "c99059c0315591f1a0db7ad6002000288ab8dc72"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
|
"url": "https://api.github.com/repos/nette/utils/zipball/c99059c0315591f1a0db7ad6002000288ab8dc72",
|
||||||
"reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
|
"reference": "c99059c0315591f1a0db7ad6002000288ab8dc72",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2 <8.3"
|
"php": "8.2 - 8.5"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"nette/di": "<3.0.6"
|
"nette/finder": "<3",
|
||||||
|
"nette/schema": "<1.2.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"nette/tester": "~2.0",
|
"jetbrains/phpstorm-attributes": "^1.2",
|
||||||
"phpstan/phpstan": "^1.0",
|
"nette/tester": "^2.5",
|
||||||
"tracy/tracy": "^2.3"
|
"phpstan/phpstan-nette": "^2.0@stable",
|
||||||
|
"tracy/tracy": "^2.9"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-gd": "to use Image",
|
"ext-gd": "to use Image",
|
||||||
@@ -2025,16 +2030,18 @@
|
|||||||
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
|
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
|
||||||
"ext-json": "to use Nette\\Utils\\Json",
|
"ext-json": "to use Nette\\Utils\\Json",
|
||||||
"ext-mbstring": "to use Strings::lower() etc...",
|
"ext-mbstring": "to use Strings::lower() etc...",
|
||||||
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()",
|
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
|
||||||
"ext-xml": "to use Strings::length() etc. when mbstring is not available"
|
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "3.2-dev"
|
"dev-master": "4.1-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Nette\\": "src"
|
||||||
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"src/"
|
"src/"
|
||||||
]
|
]
|
||||||
@@ -2075,9 +2082,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nette/utils/issues",
|
"issues": "https://github.com/nette/utils/issues",
|
||||||
"source": "https://github.com/nette/utils/tree/v3.2.8"
|
"source": "https://github.com/nette/utils/tree/v4.1.1"
|
||||||
},
|
},
|
||||||
"time": "2022-09-12T23:36:20+00:00"
|
"time": "2025-12-22T12:14:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nikic/php-parser",
|
"name": "nikic/php-parser",
|
||||||
@@ -2221,6 +2228,69 @@
|
|||||||
],
|
],
|
||||||
"time": "2022-12-20T19:00:15+00:00"
|
"time": "2022-12-20T19:00:15+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ossycodes/friendlycaptcha",
|
||||||
|
"version": "v3.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/ossycodes/friendlycaptcha.git",
|
||||||
|
"reference": "b18dfab44ee5fff7d75412232eb6f834864efde6"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/ossycodes/friendlycaptcha/zipball/b18dfab44ee5fff7d75412232eb6f834864efde6",
|
||||||
|
"reference": "b18dfab44ee5fff7d75412232eb6f834864efde6",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/guzzle": "^7.0",
|
||||||
|
"illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0",
|
||||||
|
"php": "^7.4|^8.0|^8.1|^8.2|^8.3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0",
|
||||||
|
"phpunit/phpunit": "^8.0 || ^9.5 || ^10.5 || ^11.0 || ^12.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"aliases": {
|
||||||
|
"FriendlyCaptcha": "Ossycodes\\FriendlyCaptcha\\Facades\\FriendlyCaptcha"
|
||||||
|
},
|
||||||
|
"providers": [
|
||||||
|
"Ossycodes\\FriendlyCaptcha\\FriendlyCaptchaServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Ossycodes\\FriendlyCaptcha\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "ossycodes",
|
||||||
|
"email": "osaigbovoemmanuel1@gmail.com",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A simple package to help integrate FriendlyCaptcha in your Laravel applications.",
|
||||||
|
"homepage": "https://github.com/ossycodes/friendlycaptcha",
|
||||||
|
"keywords": [
|
||||||
|
"captcha",
|
||||||
|
"friendlycaptcha",
|
||||||
|
"laravel"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/ossycodes/friendlycaptcha/issues",
|
||||||
|
"source": "https://github.com/ossycodes/friendlycaptcha/tree/v3.0.0"
|
||||||
|
},
|
||||||
|
"time": "2025-05-08T13:30:49+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "phpoption/phpoption",
|
"name": "phpoption/phpoption",
|
||||||
"version": "1.9.0",
|
"version": "1.9.0",
|
||||||
@@ -7931,12 +8001,12 @@
|
|||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"stability-flags": [],
|
"stability-flags": {},
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^8.0.2"
|
"php": "^8.0"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": {},
|
||||||
"plugin-api-version": "2.3.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|||||||
0
config/app.php
Normal file → Executable file
0
config/auth.php
Normal file → Executable file
0
config/broadcasting.php
Normal file → Executable file
0
config/cache.php
Normal file → Executable file
0
config/database.php
Normal file → Executable file
12
config/filesystems.php
Normal file → Executable file
@@ -48,12 +48,12 @@ return [
|
|||||||
'root' => storage_path('app'),
|
'root' => storage_path('app'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'public' => [
|
//'public' => [
|
||||||
'driver' => 'local',
|
// 'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
// 'root' => storage_path('app/public'),
|
||||||
'url' => env('APP_URL').'/storage',
|
// 'url' => env('APP_URL').'/storage',
|
||||||
'visibility' => 'public',
|
// 'visibility' => 'public',
|
||||||
],
|
//],
|
||||||
|
|
||||||
's3' => [
|
's3' => [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
|
|||||||
0
config/mail.php
Normal file → Executable file
0
config/queue.php
Normal file → Executable file
0
config/services.php
Normal file → Executable file
0
config/session.php
Normal file → Executable file
0
config/view.php
Normal file → Executable file
0
database/.gitignore
vendored
Normal file → Executable file
0
database/factories/ModelFactory.php
Normal file → Executable file
0
database/migrations/2014_10_12_000000_create_users_table.php
Normal file → Executable file
0
database/migrations/2014_10_12_100000_create_password_resets_table.php
Normal file → Executable file
0
database/migrations/2024_02_27_000000_create_pagestats_table.php
Normal file → Executable file
0
database/seeds/DatabaseSeeder.php
Normal file → Executable file
5
docker-compose.dev.yml
Normal file → Executable file
@@ -22,3 +22,8 @@ services:
|
|||||||
MYSQL_DATABASE: forge
|
MYSQL_DATABASE: forge
|
||||||
MYSQL_USER: forge
|
MYSQL_USER: forge
|
||||||
MYSQL_PASSWORD: secret
|
MYSQL_PASSWORD: secret
|
||||||
|
mailpit:
|
||||||
|
image: axllent/mailpit:latest
|
||||||
|
ports:
|
||||||
|
- "8025:8025"
|
||||||
|
- "1025:1025"
|
||||||
|
|||||||
0
docker-compose.yml
Normal file → Executable file
0
docker/apache.conf
Normal file → Executable file
8
docker/apache.dev.conf
Normal file → Executable file
@@ -23,7 +23,7 @@ ServerTokens Prod
|
|||||||
<VirtualHost *:443>
|
<VirtualHost *:443>
|
||||||
ServerName localhost
|
ServerName localhost
|
||||||
ServerAdmin support@websight.nl
|
ServerAdmin support@websight.nl
|
||||||
DocumentRoot /var/www/html
|
DocumentRoot /var/www/html/public
|
||||||
|
|
||||||
SSLEngine on
|
SSLEngine on
|
||||||
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
@@ -32,15 +32,15 @@ ServerTokens Prod
|
|||||||
SSLProtocol All -SSLv2 -SSLv3
|
SSLProtocol All -SSLv2 -SSLv3
|
||||||
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
|
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
|
||||||
|
|
||||||
<Directory /var/www/html/>
|
<Directory /var/www/html/public>
|
||||||
Options -Indexes +FollowSymLinks +MultiViews
|
Options -Indexes +FollowSymLinks +MultiViews
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
Allow from all
|
Allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
ErrorLog /var/log/apache2/ssl-vhost-error.log
|
ErrorLog /var/log/apache2/error.log
|
||||||
CustomLog /var/log/apache2/ssl-vhost-access.log combined
|
CustomLog /var/log/apache2/access.log combined
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|||||||
0
download_mediaplayer_plugins.php
Normal file → Executable file
4
env.example
Normal file → Executable file
@@ -37,3 +37,7 @@ DB_PASSWORD=dbpass
|
|||||||
|
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
QUEUE_DRIVER=sync
|
QUEUE_DRIVER=sync
|
||||||
|
|
||||||
|
FRIENDLY_CAPTCHA_SITEKEY=
|
||||||
|
FRIENDLY_CAPTCHA_SECRET=
|
||||||
|
FRIENDLY_CAPTCHA_DEBUG=true
|
||||||
|
|||||||
0
package-lock.json
generated
Normal file → Executable file
0
package.json
Normal file → Executable file
0
phpunit.xml
Normal file → Executable file
0
public/.htaccess
Normal file → Executable file
0
public/android-chrome-192x192.png
Normal file → Executable file
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
0
public/android-chrome-512x512.png
Normal file → Executable file
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 183 KiB |
0
public/apple-touch-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
0
public/css/airplay.png
Normal file → Executable file
|
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
0
public/css/airplay.svg
Normal file → Executable file
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
0
public/css/app.css
vendored
Normal file → Executable file
0
public/css/app.css.map
Normal file → Executable file
0
public/css/bootstrap-grid.css
vendored
Normal file → Executable file
0
public/css/bootstrap-grid.css.map
Normal file → Executable file
0
public/css/bootstrap-grid.min.css
vendored
Normal file → Executable file
0
public/css/bootstrap-grid.min.css.map
Normal file → Executable file
0
public/css/chromecast.png
Normal file → Executable file
|
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 951 B |
0
public/css/chromecast.svg
Normal file → Executable file
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
0
public/css/components/posts.css.map
Normal file → Executable file
0
public/css/components/pretty_photo.css.map
Normal file → Executable file
0
public/css/images/ui-bg_flat_0_aaaaaa_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
0
public/css/images/ui-bg_flat_0_eeeeee_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
0
public/css/images/ui-bg_flat_55_ffffff_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |