commit 16cf2d0d62a4acefa04824ca33034201d686190b
parent ec765865cbe45cd17d0314b72a2b97fc8fe7c249
Author: dankert <devnull@localhost>
Date: Thu, 4 Oct 2007 23:49:13 +0200
Attribut "readonly" zulassen. Wenn Readonly, dann auch ein "hidden"-Eingabefeld erzeugen, damit Wert vom Browser versendet wird.
Diffstat:
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php
@@ -19,7 +19,7 @@ editor = name:*,type:*
else =
if = equals,value,invert,not,empty,present,contains,true,false
image = config,file,url,icon,align:left,type,elementtype,fileext
-input = class:,default:,type:text,index,name:*,prefix,value,size:40,maxlength:256,onchange:
+input = class:,default:,type:text,index,name:*,prefix,value,size:40,maxlength:256,onchange:,readonly:false
inputarea= name,rows:10,cols:40,value,index,onchange,prefix,class:,default:
insert = file:*
label = for:*,value
diff --git a/themes/default/include/html/checkbox.inc.php b/themes/default/include/html/checkbox.inc.php
@@ -3,4 +3,10 @@
$checked = $$attr_name;
else
$checked = $attr_default;
-?><input type="checkbox" id="id_<?php echo $attr_name ?>" name="<?php echo $attr_name ?>" <?php if ($attr_readonly) echo ' disabled="disabled"' ?> value="1" <?php if( $checked ) echo 'checked="checked"' ?> /><?php unset($attr_name); unset($attr_readonly); unset($attr_default); ?>-
\ No newline at end of file
+?><input type="checkbox" id="id_<?php echo $attr_name ?>" name="<?php echo $attr_name ?>" <?php if ($attr_readonly) echo ' disabled="disabled"' ?> value="1" <?php if( $checked ) echo 'checked="checked"' ?> /><?php
+
+if ( $attr_readonly && $checked )
+{
+?><input type="hidden" name="<?php echo $attr_name ?>" value="1" /><?php
+}
+?><?php unset($attr_name); unset($attr_readonly); unset($attr_default); ?>+
\ No newline at end of file
diff --git a/themes/default/include/html/input.inc.php b/themes/default/include/html/input.inc.php
@@ -1,2 +1,5 @@
<?php if(!isset($attr_default)) $attr_default='';
-?><input id="id_<?php echo $attr_name ?>" name="<?php echo $attr_name ?>" 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 ?>" onxxxMouseOver="this.focus();" />-
\ No newline at end of file
+?><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 ($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