From d495568cb8aa0e52f73b64349cca5267117aac8d Mon Sep 17 00:00:00 2001 From: Sinevia Date: Thu, 12 Apr 2018 06:11:02 +0100 Subject: [PATCH] Update CmsController.php --- src/Http/Controllers/CmsController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Http/Controllers/CmsController.php b/src/Http/Controllers/CmsController.php index 52ac57d..56ca446 100644 --- a/src/Http/Controllers/CmsController.php +++ b/src/Http/Controllers/CmsController.php @@ -200,6 +200,11 @@ function getPageManager() { $q = $q->orderBy($orderby, $sort); $pages = $q->paginate($results_per_page); + foreach ($pages as $i => $page) { + $default_translation = $page->translation('en'); + $pages[$i]->Title = $default_translation->Title; + } + return view('cms::admin/page-manager', get_defined_vars()); } @@ -318,13 +323,13 @@ function getWidgetUpdate() { $parameters = request('Parameters', old('Parameters', json_decode($widget->Parameters, true))); $cache = request('Cache', old('Cache', $widget->Cache)); $type = request('Type', old('Type', $widget->Type)); - + $widgetsDirectory = \Sinevia\Cms\Models\Widget::path(); - + if ($widgetsDirectory == '') { return back()->withErrors('Widgets directory not recognized. Is it set in the CMS configuration settings?'); } - + if (is_dir($widgetsDirectory) == false) { return back()->withErrors('Widgets directory does not exist. Is it a valid directory set in the CMS configuration settings?'); } @@ -1053,5 +1058,3 @@ function postWidgetUpdate() { } } - -?>