FEATURE: make title in contents overview translatable and modifiable by module

This commit is contained in:
Michal Kváček
2016-09-05 00:00:52 +02:00
parent 8c4b1ad69b
commit 5ef2630810
4 changed files with 17 additions and 6 deletions
+10 -4
View File
@@ -32,11 +32,16 @@ class ContentOverview extends Controller
{
$moduleFilterHandler = false;
$perPage = Input::get('perPage') ? Input::get('perPage') : 20;
$pageHeading = 'admin/contents.overview';
// does user want to filter results using module?
if (is_numeric($moduleId)) {
$module = Module::findOrFail($moduleId);
$moduleFilterHandler = $module->handler;
if (is_callable([$module->handler, 'getOverviewTitle'])) {
$pageHeading = call_user_func([$module->handler, 'getOverviewTitle']);
}
}
// get pages for overview
@@ -47,10 +52,11 @@ class ContentOverview extends Controller
$homepage = $this->content->getHomepage();
return view('admin.content.overview', [
'pages' => $pages,
'homepage' => $homepage,
'statuses' => ContentStatuses::getWithTranslations(),
'module' => isset($module) ? $module : null
'pages' => $pages,
'homepage' => $homepage,
'pageHeading' => $pageHeading,
'statuses' => ContentStatuses::getWithTranslations(),
'module' => isset($module) ? $module : null
]);
}
}