openrat-cms

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

commit 5c79b022fe0c3ff50c0e35bf20e784cbd919234b
parent ae15f371cba7ba5f82f246674a5bed400c39e0ef
Author: Jan Dankert <devnull@localhost>
Date:   Sat,  2 Mar 2013 16:12:27 +0100

Bei Benutzung der Menüpunkte im Header-Menü wird nicht mehr die View ersetzt, sondern ein (modaler) Dialog gestartet.

Diffstat:
themes/default/css/openrat.css.php | 27+++++++++++++++++++++++++++
themes/default/include/html/form-end.inc.php | 4++--
themes/default/include/html/header.inc.php | 2+-
themes/default/js/openrat.js | 49+++++++++++++++++++++++++++++++++++++++++++++++--
themes/default/js/plugin/jquery-plugin-orLinkify.js | 12+++++++++++-
themes/default/layout/index.php | 5+++++
6 files changed, 93 insertions(+), 6 deletions(-)

diff --git a/themes/default/css/openrat.css.php b/themes/default/css/openrat.css.php @@ -1393,8 +1393,35 @@ div#workbench > div.bar.modal box-shadow: 0px 0px 40px <?php echo $_GET['text_color']; ?>; } + + + +div#dialog +{ + background-color:<?php echo $_GET['background_color']; ?>; + color:<?php echo $_GET['text_color']; ?>; + overflow: auto; + + /*width:60%;*/ + position:absolute; + top:5%; + left:10%; + width:80%; + height:80%; + + z-index: 104; + + border:1px solid <?php echo $_GET['text_color']; ?> !important; + + + -webkit-box-shadow: 0px 0px 40px <?php echo $_GET['text_color']; ?>; + -moz-box-shadow: 0px 0px 40px <?php echo $_GET['text_color']; ?>; + box-shadow: 0px 0px 40px <?php echo $_GET['text_color']; ?>; + +} + /* Voreingestellte Schriftart */ body { diff --git a/themes/default/include/html/form-end.inc.php b/themes/default/include/html/form-end.inc.php @@ -4,11 +4,11 @@ <div class="bottom"> <div class="command <?php echo $attr_tmp_visible?'visible':'invisible' ?>"> - <input type="button" class="submit ok" value="<?php echo $attr_tmp_ok_label ?>" onclick="$(this).closest('div.window').find('form').submit();" /> + <input type="button" class="submit ok" value="<?php echo $attr_tmp_ok_label ?>" onclick="$(this).closest('div.window').find('form').submit(); " /> <!-- Cancel-Button nicht anzeigen, wenn cancel==false. --> <?php if ($attr_tmp_show_cancel) { ?> - <input type="button" class="submit cancel" value="<?php echo lang('CANCEL') ?>" onclick="$(this).closest('div.window').find('ul.views > li.active').click();" /> + <input type="button" class="submit cancel" value="<?php echo lang('CANCEL') ?>" onclick="$('div#dialog').hide(); $('div#filler').fadeOut(500); $(this).closest('div.window').find('ul.views > li.active').click();" /> <?php } ?> </div> </div> diff --git a/themes/default/include/html/header.inc.php b/themes/default/include/html/header.inc.php @@ -8,7 +8,7 @@ <img src="<?php echo $image_dir ?>icon/window/down.gif" /> <div class="headermenu"> <?php foreach( explode(',',$attr_views) as $attr_tmp_view ) { ?> - <a href="javascript:void(0);" data-type="view" data-method="<?php echo $attr_tmp_view ?>"> + <a href="javascript:void(0);" data-type="modal" data-method="<?php echo $attr_tmp_view ?>"> <img src="<?php echo $image_dir ?>icon/<?php echo $attr_tmp_view ?>.png" /><?php echo lang('MENU_'.$attr_tmp_view) ?> </a> <?php } ?> diff --git a/themes/default/js/openrat.js b/themes/default/js/openrat.js @@ -33,6 +33,23 @@ function refreshAll() refreshTitleBar(); refreshWorkbench(); + + $('div#filler').click( function() + { + if ( $('div#dialog').hasClass('modal') ) + { + + } + else + { + $('div#dialog').html('').hide(); // Dialog beenden + + //$('div.modaldialog').fadeOut(500); + //$('div#workbench').removeClass('modal'); // Modalen Dialog beenden. + $('div#filler').fadeOut(500); // Filler beenden + + } + }); } @@ -243,7 +260,7 @@ function loadView(jo, url ) } $(this).removeClass("loader"); - registerViewEvents( jo ) + registerViewEvents( jo ); }); } @@ -374,7 +391,7 @@ function registerViewEvents( viewEl ) $(viewEl).find('div.headermenu > a').each( function(idx,el) { // Jeden Untermenüpunkt zum Fenstermenü hinzufügen. - $(el).wrap('<div class="entry clickable perview" />').parent().appendTo( $(viewEl).closest('div.frame').find('div.menu div.dropdown').first() ); + $(el).wrap('<div class="entry clickable modal perview" />').parent().appendTo( $(viewEl).closest('div.frame').find('div.menu div.dropdown').first() ); } ); $(viewEl).find('div.header > a.back').each( function(idx,el) @@ -586,6 +603,34 @@ function startView( element,view ) /** + * Setzt neuen modalen Dialog und aktualisiert alle Fenster. + * @param element + * @param action Action + * @param id Id + */ +function startDialog( element,method,action,modal ) +{ + //alert( "startView: "+$(element).html() ); + var action = $(element).closest('div.frame').attr('data-action'); + var id = $(element).closest('div.frame').attr('data-id' ); + var url = createUrl(action, method, id); + //alert( "startView: "+action+"/"+view+"#"+id ); + + $('div#filler').fadeTo(500,0.5); + $('div#dialog').html('<div class="frame" data-action="'+action+'" data-method="'+method+'" data-id="'+id+'"><div class="window"><div class="content" /></div></div>'); + $('div#dialog').show(); + + loadView( $('div#dialog div.content'), url ); + + //$('div#workbench div.frame.modal').parent().addClass('modal'); + //$('div#workbench').addClass('modal'); + + // Alle refresh-fähigen Views mit dem neuen Objekt laden. + // refreshAllRefreshables(); +} + + +/** * Setzt neue modale View und aktualisiert alle Fenster. * @param element * @param action Action diff --git a/themes/default/js/plugin/jquery-plugin-orLinkify.js b/themes/default/js/plugin/jquery-plugin-orLinkify.js @@ -20,7 +20,17 @@ jQuery.fn.orLinkify = function() { startView(this, $(this).attr('data-method') ); } - + + else if ( type == 'modal' ) + { + startDialog(this, $(this).attr('data-method'),$(this).attr('data-action'),true ); + } + + else if ( type == 'dialog' ) + { + startDialog(this, $(this).attr('data-method'),$(this).attr('data-action'),false ); + } + else if ( type == 'url' ) { submitUrl(this,$(this).attr('data-url') ); diff --git a/themes/default/layout/index.php b/themes/default/layout/index.php @@ -115,6 +115,11 @@ var REQ_PARAM_TARGET = '<?php echo REQ_PARAM_TARGET ?>'; <div id="workbench"> </div> + +<div id="dialog" class="bar wide"> +</div> + + <script type="text/javascript"> <!-- document.writeln("<div class=\"invisible\">");