openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a3200a6a25a5e6517ed8d8dadc8e69c4929d95e1
parent 83741d316f4f9c28ee98cafadf6f690bc5d3f17c
Author: Jan Dankert <devnull@localhost>
Date:   Tue,  8 Nov 2011 23:24:09 +0100

Die CSS-Datei mit dem Benutzer-Stil aktualisieren (nach Login und Profiländerung)

Diffstat:
action/LoginAction.class.php | 3++-
action/ProfileAction.class.php | 2+-
themes/default/js/openrat.js | 10++++++++++
3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/action/LoginAction.class.php b/action/LoginAction.class.php @@ -720,7 +720,7 @@ class LoginAction extends Action $this->evaluateRequestVars(); $object = Session::getObject(); - // Falls noch kein Objekt ausgew�hlt, dann das zuletzt ge�nderte benutzen. + // Falls noch kein Objekt ausgewaehlt, dann das zuletzt ge�nderte benutzen. if ( !is_object($object) && @$conf['login']['start']['start_lastchanged_object'] ) { $objectid = Value::getLastChangedObjectByUserId($user->userid); @@ -744,6 +744,7 @@ class LoginAction extends Action Session::setProjectModel( $model ); } + $this->setStyle( $user->style ); $this->setPerspective('start'); } diff --git a/action/ProfileAction.class.php b/action/ProfileAction.class.php @@ -58,12 +58,12 @@ class ProfileAction extends Action if ( !empty($this->user->fullname) ) { $this->user->save(); + $this->setStyle($this->user->style); $this->addNotice('user',$this->user->name,'SAVED','ok'); } else { $this->addValidationError('fullname'); - $this->callSubAction('edit'); } } diff --git a/themes/default/js/openrat.js b/themes/default/js/openrat.js @@ -447,10 +447,20 @@ function doResponse(data,status) if ( 'refresh' in data ) refreshAll(); + + if ( data.new_style ) + setUserStyle( data.new_style ); + + } +function setUserStyle( url ) +{ + $('#userstyle').attr('href',url); +} + /* $(function(){ //Document ready shorthand