openrat-cms

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

commit f62ecc9efb33071a01b80907608b05635fc3666e
parent a3200a6a25a5e6517ed8d8dadc8e69c4929d95e1
Author: Jan Dankert <devnull@localhost>
Date:   Wed,  9 Nov 2011 00:19:22 +0100

Neues Element \"Header\" mit Untermenü, Weiterleiten nach POST an nächste View.

Diffstat:
action/Action.class.php | 8+++++++-
action/ProfileAction.class.php | 15+++++++--------
action/ProfileAction.ini.php | 21---------------------
themes/default/css/layout.css | 26+++++++++++++++++++++++---
themes/default/css/user/default.css | 11++++++-----
themes/default/images/icon/window/back.gif | 0
themes/default/images/icon/window/down.gif | 0
themes/default/include/elements.ini.php | 1+
themes/default/include/html/header.inc.php | 7+++++++
themes/default/js/openrat.js | 30+++++++++++++++++++++++++-----
themes/default/templates/profile/edit.tpl.src.php | 3++-
themes/default/templates/profile/mail.tpl.src.php | 1+
themes/default/templates/profile/memberships.tpl.src.php | 25++++++++++++-------------
13 files changed, 91 insertions(+), 57 deletions(-)

diff --git a/action/Action.class.php b/action/Action.class.php @@ -78,7 +78,13 @@ class Action function setStyle( $style ) { - Session::set('style',$style); + $this->setTemplateVar( "new_style", OR_THEMES_EXT_DIR.'default/css/user/'.$style.'.css' ); + } + + + function nextView( $viewName ) + { + $this->setTemplateVar( "next_view", $viewName ); } diff --git a/action/ProfileAction.class.php b/action/ProfileAction.class.php @@ -139,7 +139,7 @@ class ProfileAction extends Action /** * Anzeige einer Maske zum Ändern der E-Mail-Adresse */ - function mail() + function mailView() { } @@ -148,7 +148,7 @@ class ProfileAction extends Action /* * Es wird eine E-Mail mit einem Freischaltcode an die eingegebene Adresse geschickt. */ - function mailcode() + function mailAction() { srand ((double)microtime()*1000003); $code = rand(); // Zufalls-Freischaltcode erzeugen @@ -173,15 +173,15 @@ class ProfileAction extends Action if ( $mail->send() ) { - $this->addNotice('user',$this->user->name,'mail_sent',OR_NOTICE_OK); // Meldung + $this->addNotice('user',$this->user->name,'mail_sent',OR_NOTICE_OK); // Meldung + $this->nextView('confirmmail'); } else { $this->addNotice('user',$this->user->name,'mail_not_sent',OR_NOTICE_ERROR,array(),$mail->error); // Meldung - $this->callSubAction('mail'); return; } - } + } } @@ -190,7 +190,7 @@ class ProfileAction extends Action * Anzeige einer Maske, in die der Freischaltcode für das * Ändern der E-Mail-Adresse eingetragen werden muss. */ - function confirmmail() + function confirmmailView() { } @@ -199,7 +199,7 @@ class ProfileAction extends Action /** * Abspeichern der neuen E-Mail-Adresse */ - function savemail() + function confirmmailAction() { $sessionCode = Session::get('mailChangeCode'); $newMail = Session::get('mailChangeMail'); @@ -218,7 +218,6 @@ class ProfileAction extends Action { // Best�tigungscode stimmt nicht. $this->addValidationError('code','code_not_match'); - $this->callSubAction('confirmmail'); } } diff --git a/action/ProfileAction.ini.php b/action/ProfileAction.ini.php @@ -1,35 +1,14 @@ [default] -goto=edit [edit] -menu=edit -editable=true -write=true [memberships] -menu=edit -write=true [pw] -write=true -menu=edit [mail] -target=mailcode -menu=edit - -[mailcode] -goto=confirmmail [confirmmail] -target=savemail -menu=edit - -[savemail] -goto=edit [settings] -menu=edit -write=true - diff --git a/themes/default/css/layout.css b/themes/default/css/layout.css @@ -303,7 +303,8 @@ div.dropdown part.entry:hover } /*Dropdown anzeigen!!!*/ -div#header div:hover div.dropdown +div#header div:hover div.dropdown, +div.window div.header:hover div.dropdown { display:block; } @@ -684,9 +685,27 @@ div.menu fieldset { - xclear:left; + border:1px solid grey; + + border-bottom:0px; + border-left:0px; + border-right:0px; + + margin-top:5px; + margin-bottom:0px; + margin-left:0px; + margin-right:0px; } +fieldset legend +{ + margin-left:30px; + /* + padding-left:30px; + */ +} + + form.xlogin { @@ -967,7 +986,8 @@ div.window { div#header, /* Titelleite-Hintergrund */ div.window div.content, /* Fensterinhalt-Hintergrund */ div.window ul.menu li a, /* Tabs */ -xdiv.window ul.menu li > span /* Tabs */ +xdiv.window ul.menu li > span, /* Tabs */ +div.window div.header /* Fenster-Header */ { background-color: gray; } diff --git a/themes/default/css/user/default.css b/themes/default/css/user/default.css @@ -30,8 +30,8 @@ xlabel + input /* Zwischen-Ueberschriften */ fieldset { - border:1px solid grey; /* + border:1px solid grey; border-bottom:0px; border-left:0px; @@ -41,16 +41,17 @@ fieldset margin-left:0px; margin-right:0px; */ + /* margin:0px; margin-top:20px; margin-bottom:20px; padding:15px; - -moz-border-radius:5px; /* Mozilla */ - -webkit-border-radius:5px; /* Webkit */ - -khtml-border-radius:5px; /* Konqui */ + + -moz-border-radius:5px; + -webkit-border-radius:5px; + -khtml-border-radius:5px; border-radius:5px; - /* -webkit-box-shadow: 3px 2px 5px gray; -moz-box-shadow: 3px 2px 5px gray; box-shadow: 3px 2px 5px gray; diff --git a/themes/default/images/icon/window/back.gif b/themes/default/images/icon/window/back.gif Binary files differ. diff --git a/themes/default/images/icon/window/down.gif b/themes/default/images/icon/window/down.gif Binary files differ. diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php @@ -16,6 +16,7 @@ frame = file,name,scrolling frameset = rows,columns frameset-page=menu hidden = name:*,default +header = name:,views,back:false editor = name:*,type:* else = if = equals,value,not,empty,present,contains,greaterthan,lessthan,true,false diff --git a/themes/default/include/html/header.inc.php b/themes/default/include/html/header.inc.php @@ -0,0 +1,6 @@ +<div class="header"><?php if ($attr_back) { ?><a href="javascript:void(0);" onclick="javascript:refreshActualView(this);"><img src="<?php echo $image_dir ?>icon/window/back.gif" /><?php echo lang('BACK') ?></a><?php } ?><?php if(!empty($attr_views)) { ?><img src="<?php echo $image_dir ?>icon/window/down.gif" /><div class="dropdown"><?php foreach( explode(',',$attr_views) as $attr_tmp_view ) { ?> + <a class="entry" href="javascript:void(0);" onclick="javascript:startView(this,'<?php echo $attr_tmp_view ?>');"><?php echo lang('MENU_'.$attr_tmp_view) ?></a> +<?php } ?> +</div> +<?php } ?> +</div>+ \ No newline at end of file diff --git a/themes/default/js/openrat.js b/themes/default/js/openrat.js @@ -18,11 +18,11 @@ function refreshAll() function refreshAllRefreshables() { - + // Default-Inhalte der einzelnen Views laden. $('div#workbench div.refreshable li.active').each( function() { var method = $(this).attr('data-method'); - var p = $(this).parent().parent().parent().parent().parent(); + var p = $(this).closest('div.frame'); var action = p.attr('data-action'); var id = p.attr('data-id'); //alert(method+' '+action); @@ -31,6 +31,24 @@ function refreshAllRefreshables() { //alert('go2'); loadView( p.find('div.filler'),createUrl(action,method,id)); }); + +} + + + +function refreshActualView(element) { + + // Default-Inhalte der einzelnen Views laden. + $(element).closest('div.frame').find('li.active').each( function() { + var method = $(this).attr('data-method'); + var p = $(this).closest('div.frame'); + var action = p.attr('data-action'); + var id = p.attr('data-id'); + //alert(method+' '+action); + + + loadView( p.find('div.filler'),createUrl(action,method,id)); + }); } @@ -47,7 +65,7 @@ function refreshWorkbench() // Default-Inhalte der einzelnen Views laden. $(this).fadeIn('fast').find('li.active').each( function() { var method = $(this).attr('data-method'); - var p = $(this).parent().parent().parent().parent().parent(); + var p = $(this).closest('div.frame'); var action = p.attr('data-action'); //alert(method+' '+action); @@ -59,7 +77,7 @@ function refreshWorkbench() // OnClick-Handler für Klick auf einen Tab-Reiter. $('ul.views > li.action').click( function() { var method = $(this).attr('data-method'); - var p = $(this).parent().parent().parent().parent().parent(); + var p = $(this).closest('div.frame'); var action = p.attr('data-action'); var id = p.attr('data-id'); p.find('ul.views li.active').removeClass('active'); @@ -337,6 +355,7 @@ function postUrl(url) */ function startView( element,view ) { + alert( "startView: "+$(element).html() ); var action = $(element).closest('div.frame').attr('data-action'); var url = createUrl(action, view, 0); loadView( $(element).closest('div.filler'), url ); @@ -451,7 +470,8 @@ function doResponse(data,status) if ( data.new_style ) setUserStyle( data.new_style ); - + if ( data.next_view ) + startView( $('div.filler').first(),data.next_view ); } diff --git a/themes/default/templates/profile/edit.tpl.src.php b/themes/default/templates/profile/edit.tpl.src.php @@ -1,4 +1,5 @@ dummy + header views:mail form method:post window icon:user name:user_profile row @@ -17,7 +18,7 @@ dummy text var:mail class:filename if false:mode:edit newline - link class:action action:profile subaction:mail + link type:view class:action action:profile subaction:mail text key:edit fieldset title:message:GLOBAL_PROP diff --git a/themes/default/templates/profile/mail.tpl.src.php b/themes/default/templates/profile/mail.tpl.src.php @@ -1,4 +1,5 @@ dummy + header back:true form method:post window icon:user name:user_profile row diff --git a/themes/default/templates/profile/memberships.tpl.src.php b/themes/default/templates/profile/memberships.tpl.src.php @@ -1,14 +1,12 @@ -dummy - window icon:user name:user_groups - row +table + row class:headline + cell + text key:name + if empty:groups + row class:data cell - fieldset title:message:groups - if empty:groups - newline - image notice:warning - text key:NOT_FOUND - newline - newline - list list:groups value:group - text var:group - newline + text key:NOT_FOUND + list list:groups value:group + row class:data + cell + text var:group+ \ No newline at end of file