commit 97bc728e02cb4f0aee28e6166da3e5455c1bfd7a
parent 643b6b260690783ca57216d5907f88a43fc5f254
Author: dankert <devnull@localhost>
Date: Thu, 27 Jan 2011 00:05:55 +0100
Fix: Editierbare Masken mit Umschalter und Abbrechen-Knopf.
Diffstat:
5 files changed, 72 insertions(+), 49 deletions(-)
diff --git a/action/Action.class.php b/action/Action.class.php
@@ -80,6 +80,8 @@ class Action
{
Session::set('style',$style);
}
+
+
/**
@@ -96,7 +98,8 @@ class Action
$this->templateVars['errors' ] = array();
$this->templateVars['notices'] = array();
-
+
+ //Html::debug($this);
if ( !$this->isEditable() || isset($_COOKIE['or_always_edit']) )
$this->templateVars['mode'] = 'edit';
else
@@ -743,7 +746,16 @@ class Action
if ( readonly() )
return false;
- return !$this->isEditable() || $this->getRequestVar('mode')=='edit' || isset($_COOKIE['or_always_edit']) || (isset($this->templateVars) && $this->templateVars['mode']=='edit');
+ if ( !$this->isEditable() )
+ return true;
+
+ if ( $this->getRequestVar('mode')=='edit' )
+ return true;
+
+ if ( isset($_COOKIE['or_always_edit']) )
+ return true;
+
+ return (isset($this->templateVars) && $this->templateVars['mode']=='edit');
}
diff --git a/do.php b/do.php
@@ -285,7 +285,7 @@ if ( ( isset($sConf['write'])
$do->subActionName = $subaction;
- $do->init();
+ $do->init();
if ( !isset($do->actionConfig[$subaction]) )
{
@@ -404,7 +404,6 @@ foreach( $views as $view=>$viewConfig )
$do->subActionName = $subaction;
- $do->init();
if ( !isset($do->actionConfig[$subaction]) )
{
@@ -413,6 +412,22 @@ foreach( $views as $view=>$viewConfig )
exit;
}
+
+
+ // Alias-Methode aufrufen.
+ if ( isset($do->actionConfig[$do->subActionName]['alias']) )
+ {
+ $subaction = $do->actionConfig[$do->subActionName]['alias'];
+ }
+ // GOTO-Methode aufrufen.
+ elseif ( isset($do->actionConfig[$do->subActionName]['goto']) )
+ {
+ $subaction = $do->actionConfig[$do->subActionName]['goto'];
+ $do->subActionName = $subaction;
+ }
+
+ $do->init();
+
$subactionConfig = $do->actionConfig[$subaction];
//Logger::trace("controller is calling subaction '$subaction'");
@@ -449,31 +464,16 @@ foreach( $views as $view=>$viewConfig )
}
- // Alias-Methode aufrufen.
- if ( isset($do->actionConfig[$do->subActionName]['alias']) )
- {
- $subaction = $do->actionConfig[$do->subActionName]['alias'];
- }
- // GOTO-Methode aufrufen.
- elseif ( isset($do->actionConfig[$do->subActionName]['goto']) )
- {
- $subaction = $do->actionConfig[$do->subActionName]['goto'];
- $do->subActionName = $subaction;
- }
-
- Logger::debug("Executing $actionClassName::$subaction");
if ( isset($do->actionConfig[$do->subActionName]['write']) )
- {
- $subactionView = $subaction.'View';
- $do->$subactionView();
- }
+ $subactionMethodName = $subaction.'View';
else
- {
- // Aufruf der Subaction
- $do->$subaction();
- }
+ $subactionMethodName = $subaction;
+
+ Logger::debug("Executing $actionClassName::$subactionMethodName");
+
+ $do->$subactionMethodName(); // Aufruf der Subaction
$views[$view]['subaction'] = $subaction;
diff --git a/themes/default/css/layout.css b/themes/default/css/layout.css
@@ -700,3 +700,15 @@ label
{
cursor: pointer;
}
+
+div.menu
+{
+ float:none;
+ height:50px;
+ xclear:left;
+}
+
+fieldset
+{
+ xclear:left;
+}+
\ No newline at end of file
diff --git a/themes/default/include/html/button.inc.php b/themes/default/include/html/button.inc.php
@@ -1,32 +1,30 @@
<?php
#IF-ATTR-VALUE type:ok#
- if ($this->isEditable() && !$this->isEditMode())
- $attr_text = 'MODE_EDIT';
- $attr_type = 'submit';
-
- if ( $this->isEditable() && readonly() )
+ if ($this->isEditable() && !$this->isEditMode() && !readonly() )
+ {
$attr_type = ''; // Knopf nicht anzeigen
+ ?><a class="action" href="<?php echo Html::url($actionName,$subactionName,0,array('mode'=>'edit')) ?>"><span title="<?php echo lang('MODE_EDIT_DESC') ?>"><?php echo langHtml('MODE_EDIT') ?></span></a><?php
+ } else
+ {
+ $attr_type = 'submit';
+ }
#END-IF
#IF-ATTR src#
- $attr_type = 'image';
+ $attr_type = 'image';
+ $attr_tmp_src = $image_dir.'icon_'.$attr_src.IMG_ICON_EXT;
#ELSE
- $attr_src = '';
+ $attr_tmp_src = '';
#END-IF
-
- if ( !empty($attr_type) ) {
-?><input type="<?php echo $attr_type ?>"<?php if(isset($attr_src)) { ?> src="<?php echo $image_dir.'icon_'.$attr_src.IMG_ICON_EXT ?>"<?php } ?> name="<?php echo $attr_value ?>" class="%class%" title="<?php echo lang($attr_text.'_DESC') ?>" value=" <?php echo langHtml($attr_text) ?> " /><?php unset($attr_src)
-?><?php }
-
-
- #IF-ATTR-VALUE type:x-ok#
- // 2. Knopf "Cancel"
- if ($this->isEditable() && $this->isEditMode())
- $attr_text = 'CANCEL';
- $attr_type = 'submit';
- if ( !empty($attr_type) )
- {
-?><a class="action" href="<?php Html::url('','',0,array()) ?>"><span title="<?php echo lang($attr_text.'_DESC') ?>"><?php echo langHtml($attr_text) ?></span></a><?php
- }
+ if ( !empty($attr_type)) {
+?>
+<input type="<?php echo $attr_type ?>"<?php if(isset($attr_src)) { ?> src="<?php $attr_tmp_src ?>"<?php } ?> name="<?php echo $attr_value ?>" class="%class%" title="<?php echo lang($attr_text.'_DESC') ?>" value=" <?php echo langHtml($attr_text) ?> " /><?php unset($attr_src); ?>
+<?php }
+ #IF-ATTR-VALUE type:ok#
+ if ($this->isEditable() && $this->isEditMode() )
+ {
+ // 2. Knopf "Cancel"
+ ?><a class="action" href="<?php echo Html::url($actionName,$subactionName,0,array('mode'=>'')) ?>"><span title="<?php echo lang('CANCEL_DESC') ?>"><?php echo langHtml('CANCEL') ?></span></a><?php
+ }
#END-IF
?>
\ No newline at end of file
diff --git a/themes/default/include/html/input.inc.php b/themes/default/include/html/input.inc.php
@@ -10,4 +10,4 @@
if ($attr_readonly) {
/* Nur anzeigen */
?><input type="hidden" id="id_<?php echo $attr_name ?>" name="<?php echo $attr_name ?>" value="<?php echo $tmp_value ?>" /><?php
- } } else { ?><a href="<?php echo Html::url('','',0,array('mode'=>'edit')) ?>"><span class="<?php echo $attr_class ?>"><?php echo $tmp_value ?></span></a><?php } ?>-
\ No newline at end of file
+ } } else { ?><a title="<?php echo langHtml('EDIT') ?>" href="<?php echo Html::url($actionName,$subactionName,0,array('mode'=>'edit')) ?>"><span class="<?php echo $attr_class ?>"><?php echo $tmp_value ?></span></a><?php } ?>+
\ No newline at end of file