Toggle visibilty of Dashboard Editor (#11321)

* Toggle visibilty of Dashboard Editor

* code climate

* reposition Menu point

* add Dashboard Menu

* unclickability ob Dashboard menu

* Global Settings - Alert Default Settings

* Revert "Global Settings - Alert Default Settings"

This reverts commit a1af62b146.

* update to Frontend rewrite

* globalize hide_dashboard_editor variable

* .

* .

* remove legacy code

* update link path to laravel routing

* Travis ...

* Travis ...
This commit is contained in:
SourceDoctor
2020-04-10 14:34:44 +02:00
committed by GitHub
parent d6de5cb67b
commit f7c85fedfa
6 changed files with 46 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ class UserPreferencesController extends Controller
'site_style' => UserPref::getPref($user, 'site_style'),
'site_style_default' => $styles[$default_style] ?? $default_style,
'site_styles' => $styles,
'hide_dashboard_editor' => UserPref::getPref($user, 'hide_dashboard_editor') ?? 0,
];
if (Config::get('twofactor')) {
@@ -110,6 +110,7 @@ class UserPreferencesController extends Controller
'required',
Rule::in(array_merge(['default'], array_keys($this->getValidStyles()))),
],
'hide_dashboard_editor' => 'required|integer',
];
$this->validate($request, [
@@ -122,6 +123,13 @@ class UserPreferencesController extends Controller
return response()->json(['status' => 'success']);
}
public function toggleDashboardEditor(Request $request)
{
$hide_dashboard_editor = UserPref::getPref(Auth::user(), 'hide_dashboard_editor') ? 0 : 1;
UserPref::setPref(Auth::user(), 'hide_dashboard_editor', $hide_dashboard_editor);
return redirect('overview');
}
private function getValidLocales()
{
return array_reduce(glob(resource_path('lang') . '/*', GLOB_ONLYDIR), function ($locales, $locale) {