@@ -11,7 +11,7 @@ class RadioController extends Controller
|
||||
{
|
||||
$start = $date ? (new \DateTime($date))->format('Y-m-d') : (new \DateTime("-2 day"))->format('Y-m-d');
|
||||
$end = $date ? (new \DateTime($date))->modify('+1 day')->format('Y-m-d') : (new \DateTime("+3 day"))->format('Y-m-d');
|
||||
$apiResult = $this->API('programma/schema/periode/' . $start . '/' . $end);
|
||||
$apiResult = (object) $this->API('programma/schema/periode/' . $start . '/' . $end);
|
||||
$schedule = [];
|
||||
foreach($apiResult->schedule as $program)
|
||||
{
|
||||
@@ -19,7 +19,7 @@ class RadioController extends Controller
|
||||
'starttime' => self::JsonToDateTime($program->start),
|
||||
'endtime' => self::JsonToDateTime($program->end),
|
||||
'shift' => 0,
|
||||
'program' => new \Model\Program($program->program)
|
||||
'program' => new \Model\Program((object) $program->program)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ class RadioController extends Controller
|
||||
|
||||
public function program($id)
|
||||
{
|
||||
$apiResult = $this->API('programma/details/' . (int)$id);
|
||||
$apiResult = (object) $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((object) $apiResult)]);
|
||||
}
|
||||
|
||||
public function podcast(Request $request, $id, $title = '')
|
||||
@@ -63,11 +63,11 @@ class RadioController extends Controller
|
||||
}
|
||||
|
||||
parent::registerView($request, 'podcast', $id);
|
||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast($apiResult);
|
||||
$apiResult = (object) $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast((object) $apiResult);
|
||||
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('podcast/overzicht?pagina=' . (int)max(1, $page) . '&aantal=6');
|
||||
$apiResult = (object) $this->API('podcast/overzicht?pagina=' . (int)max(1, $page) . '&aantal=6');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $_podcast)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ class RadioController extends Controller
|
||||
$viewData = [];
|
||||
if((int)$programma > 0) {
|
||||
$action = 'programma/' . (int)$programma;
|
||||
$viewData['program'] = new \Model\Program($this->API('programma/details/' . (int)$programma));
|
||||
$viewData['program'] = new \Model\Program((object) $this->API('programma/details/' . (int)$programma));
|
||||
}
|
||||
|
||||
return $this->getPodcastList($request, $action, array_merge($this->getSidebareData(), $viewData));
|
||||
@@ -99,13 +99,13 @@ class RadioController extends Controller
|
||||
$programs = [];
|
||||
$now = new \DateTimeImmutable('2 minutes ago');
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('programma/schema/recent?pagina=' . (int)max(1, $page) . '&aantal=12');
|
||||
$apiResult = (object) $this->API('programma/schema/recent?pagina=' . (int)max(1, $page) . '&aantal=12');
|
||||
foreach($apiResult->schedule as $item) {
|
||||
if(!$item->program->nonstop && !$item->program->rerun) {
|
||||
$item->start = self::JsonToDateTime($item->start);
|
||||
$item->end = self::JsonToDateTime($item->end);
|
||||
$item->current = $item->end >= $now;
|
||||
$item->program = new \Model\Program($item->program);
|
||||
$item->program = new \Model\Program((object) $item->program);
|
||||
$programs[] = $item;
|
||||
}
|
||||
}
|
||||
@@ -116,11 +116,11 @@ class RadioController extends Controller
|
||||
private function getPodcastList(Request $request, $action, $viewData = [])
|
||||
{
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('podcast/' . $action . '?pagina=' . (int)max(1, $page) . '&aantal=12');
|
||||
$apiResult = (object) $this->API('podcast/' . $action . '?pagina=' . (int)max(1, $page) . '&aantal=12');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $podcast)
|
||||
{
|
||||
$podcasts[] = new \Model\Podcast($podcast);
|
||||
$podcasts[] = new \Model\Podcast((object) $podcast);
|
||||
}
|
||||
|
||||
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
|
||||
|
||||
Reference in New Issue
Block a user