mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-22 02:25:59 +02:00
Added ability to have per user color themes in CP
This commit is contained in:
parent
6413515e75
commit
5b39a7fc19
5 changed files with 153 additions and 47 deletions
|
@ -222,4 +222,15 @@ class HomeController extends Controller
|
|||
}
|
||||
return $response->withHeader('Location', '/dashboard')->withStatus(302);
|
||||
}
|
||||
|
||||
public function selectTheme(Request $request, Response $response)
|
||||
{
|
||||
global $container;
|
||||
|
||||
$data = $request->getParsedBody();
|
||||
$_SESSION['_theme'] = ($v = substr(trim(preg_replace('/[^\x20-\x7E]/', '', $data['theme-primary'] ?? '')), 0, 30)) !== '' ? $v : 'blue';
|
||||
|
||||
$container->get('flash')->addMessage('success', 'Theme color has been set successfully');
|
||||
return $response->withHeader('Location', '/profile')->withStatus(302);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue