File modules/cms/action/profile/ProfileUserinfoAction.class.php
Last commit: Sat Dec 7 20:34:52 2024 +0100 Jan Dankert UI: New Selection for user color scheme.
1 <?php 2 namespace cms\action\profile; 3 use cms\action\Method; 4 use cms\action\ProfileAction; 5 use cms\base\Configuration; 6 use cms\ui\themes\ThemeStyle; 7 use util\Session; 8 use util\UIUtils; 9 10 class ProfileUserinfoAction extends ProfileAction implements Method { 11 12 13 /** 14 * Gets user information. 15 * If no user is logged in, default information will be returned. 16 * 17 * @return void 18 */ 19 public function view() { 20 21 $user = $this->currentUser; 22 23 $this->setTemplateVar('authenticated',$user != null ); 24 $this->setTemplateVar('name' ,$user != null ? $user->getName() : '' ); 25 $this->setTemplateVar('letter' ,$user != null ? strtoupper( @$user->getName()[0]) : '' ); 26 27 // Style scheme from user or 1 (=automatic) 28 $this->setTemplateVar('styleScheme' ,$user != null ? $user->styleScheme : 1 ); 29 30 $currentStyle = $this->getUserStyle($user); 31 $this->setTemplateVar('style',$currentStyle); 32 33 34 $themeStyle = new ThemeStyle( Configuration::subset('style')->get($currentStyle,[]) ); // user style config 35 36 // Theme base color for smartphones colorizing their status bar. 37 $this->setTemplateVar('theme-color', UIUtils::getColorHexCode($themeStyle->getThemeColor())); 38 39 // Output all theme colors 40 $this->setTemplateVar('theme' , $themeStyle->getProperties() ); 41 } 42 43 44 public function post() { 45 } 46 47 48 public function checkAccess() { 49 return true; 50 } 51 }
Downloadmodules/cms/action/profile/ProfileUserinfoAction.class.php
History Sat, 7 Dec 2024 20:34:52 +0100 Jan Dankert UI: New Selection for user color scheme. Wed, 30 Oct 2024 22:17:22 +0100 Jan Dankert UI-Refactoring: The navigation is now able to open its own dialog. Fri, 15 Apr 2022 14:51:22 +0200 dankert Refactoring: User,Config and Database info is now stored in the Request, because so there is no session required for clients which are using Basic Authorization. Tue, 22 Feb 2022 21:37:08 +0100 dankert Fix: Displaying the QRCode was broken. Now the QR code is styled with CSS :) Fri, 3 Dec 2021 23:27:44 +0100 dankert New: Only allowed methods are shown in the dropdown menu; Some security enhancements. Mon, 29 Mar 2021 02:40:31 +0200 Jan Dankert Fix: Some profile actions were not readable with a guest user. Wed, 10 Feb 2021 22:04:26 +0100 Jan Dankert Provide the theme configuration through a class. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.