Skip to content

Commit

Permalink
Update CmsController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinevia authored Apr 12, 2018
1 parent 88af5b8 commit d495568
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Http/Controllers/CmsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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?');
}
Expand Down Expand Up @@ -1053,5 +1058,3 @@ function postWidgetUpdate() {
}

}

?>

0 comments on commit d495568

Please sign in to comment.