openrat-cms

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

commit cd636edf7c401fd5dc672a0ef52033813a00ae9a
parent 2d3483d7ff8277f9b64b072a1d81e9cf0c3b3a69
Author: dankert <devnull@localhost>
Date:   Thu, 11 Sep 2008 20:57:38 +0200

Falls Edit-Mode vorhanden, aber nicht aktiv, dann Eingabefeld deaktivieren.

Diffstat:
themes/default/include/html/checkbox.inc.php | 2++
themes/default/include/html/input.inc.php | 10+++++++---
themes/default/include/html/inputarea.inc.php | 8++++++--
themes/default/include/html/radio.inc.php | 2++
4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/themes/default/include/html/checkbox.inc.php b/themes/default/include/html/checkbox.inc.php @@ -1,4 +1,6 @@ <?php + if ($this->isEditable() && $this->getRequestVar('mode')!='edit') $attr_readonly=true; + if ( isset($$attr_name) ) $checked = $$attr_name; else diff --git a/themes/default/include/html/input.inc.php b/themes/default/include/html/input.inc.php @@ -1,5 +1,9 @@ -<?php if(!isset($attr_default)) $attr_default=''; +<?php if ($this->isEditable() && $this->getRequestVar('mode')!='edit') $attr_readonly=true; + if ($attr_readonly && empty($$attr_name)) $$attr_name = '- '.lang('EMPTY').' -'; + if(!isset($attr_default)) $attr_default=''; + +?><?php if (!$attr_readonly) { ?><input<?php if ($attr_readonly) echo ' disabled="true"' ?> id="id_<?php echo $attr_name ?><?php if ($attr_readonly) echo '_disabled' ?>" name="<?php echo $attr_name ?><?php if ($attr_readonly) echo '_disabled' ?>" type="<?php echo $attr_type ?>" size="<?php echo $attr_size ?>" maxlength="<?php echo $attr_maxlength ?>" class="<?php echo $attr_class ?>" value="<?php echo isset($$attr_name)?$$attr_name:$attr_default ?>" <?php if (in_array($attr_name,$errors)) echo 'style="border-rightx:10px solid red; background-colorx:yellow; border:2px dashed red;"' ?> /><?php if ($attr_readonly) { ?><input type="hidden" id="id_<?php echo $attr_name ?>" name="<?php echo $attr_name ?>" value="<?php echo isset($$attr_name)?$$attr_name:$attr_default ?>" /><?php - } ?>- \ No newline at end of file + } } else { ?><span class="<?php echo $attr_class ?>"><?php echo isset($$attr_name)?$$attr_name:$attr_default ?></span><?php } ?>+ \ No newline at end of file diff --git a/themes/default/include/html/inputarea.inc.php b/themes/default/include/html/inputarea.inc.php @@ -1 +1,5 @@ -<textarea class="<?php echo $attr_class ?>" name="<?php echo $attr_name ?>" rows="<?php echo $attr_rows ?>" cols="<?php echo $attr_cols ?>"><?php echo htmlentities(isset($$attr_name)?$$attr_name:$attr_default) ?></textarea>- \ No newline at end of file +<?php if ($this->isEditable() && $this->getRequestVar('mode')!='edit') $attr_readonly=true; + if ( !$attr_readonly) { +?><textarea <?php if ($attr_readonly) echo ' disabled="true"' ?> class="<?php echo $attr_class ?>" name="<?php echo $attr_name ?>" rows="<?php echo $attr_rows ?>" cols="<?php echo $attr_cols ?>"><?php echo htmlentities(isset($$attr_name)?$$attr_name:$attr_default) ?></textarea><?php + } else { +?><span class="<?php echo $attr_class ?>"><?php echo isset($$attr_name)?$$attr_name:$attr_default ?></span><?php } ?>+ \ No newline at end of file diff --git a/themes/default/include/html/radio.inc.php b/themes/default/include/html/radio.inc.php @@ -1,4 +1,6 @@ <?php + if ($this->isEditable() && $this->getRequestVar('mode')!='edit') $attr_readonly=true; + if ( isset($$attr_name) ) $attr_tmp_default = $$attr_name; elseif ( isset($attr_default) )