Styled pages missed program and fragment missed
This commit is contained in:
@@ -53,8 +53,12 @@ class RadioController extends Controller
|
||||
return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
|
||||
}
|
||||
|
||||
public function podcast(Request $request, $id)
|
||||
public function podcast(Request $request, $id, $title = '')
|
||||
{
|
||||
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']));
|
||||
}
|
||||
|
||||
parent::registerView($request, 'podcast', $id);
|
||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast($apiResult);
|
||||
@@ -69,7 +73,7 @@ class RadioController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return view('podcastitem', array_merge($this->getSidebareData(), ['podcast' => $podcast, 'metadata' => $podcast->metadata, 'related' => $related, 'searchURL' => 'gemist/zoeken']));
|
||||
return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'related' => $related, 'searchURL' => 'gemist/zoeken']));
|
||||
}
|
||||
|
||||
public function podcasts(Request $request, $programma = null)
|
||||
@@ -93,7 +97,8 @@ class RadioController extends Controller
|
||||
{
|
||||
$programs = [];
|
||||
$now = new \DateTimeImmutable('2 minutes ago');
|
||||
$apiResult = $this->API('programma/schema/recent');
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $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);
|
||||
@@ -104,7 +109,7 @@ class RadioController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return view('programlist', array_merge($this->getSidebareData(), ['programs' => array_reverse($programs)]));
|
||||
return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs)]);
|
||||
}
|
||||
|
||||
private function getPodcastList(Request $request, $action, $viewData = [])
|
||||
@@ -117,7 +122,7 @@ class RadioController extends Controller
|
||||
$podcasts[] = new \Model\Podcast($podcast);
|
||||
}
|
||||
|
||||
return view($request->ajax() ? 'partial.podcastitems' : 'podcastlist', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
|
||||
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user