commit ab06655d17eee8864be224bea3ea0133cbfb7960
parent b387cbeb1cb8eaf92a894a2bcdbc8f909cf0dd47
Author: dankert <devnull@localhost>
Date: Thu, 1 Jun 2006 20:19:56 +0200
Kleine Korrektur f?r Checkboxen.
Diffstat:
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php
@@ -6,7 +6,7 @@
button = type:*
cell = width,style,class,colspan
char = type:*
-checkbox = default:false,var,readonly:false,name:*,prefix
+checkbox = default:false,readonly:false,name:*
date = date
dummy =
focus = field:*
@@ -23,7 +23,7 @@ insert = file:*
link = title,target,url,class,action,subaction,id,var1,value1
list = list:*,extract:false,key:list_key,value:list_value
newline =
-page = class
+page = class:main
password = name:*,default,class,size:40,maxlength:256
radio = readonly,name:*,value,default,prefix,suffix
row =
diff --git a/themes/default/include/html/checkbox.inc.php b/themes/default/include/html/checkbox.inc.php
@@ -1 +1,10 @@
-<input type="checkbox" name="<?php echo !empty($$attr_var)?$attr_prefix.$$attr_var:$attr_name ?>" <?php if ($attr_readonly=='true') echo ' disabled="disabled"' ?> value="1" <?php if( ($attr_default=='true')||(isset($$attr_name)&&$$attr_name) ) echo 'checked="checked"' ?> />-
\ No newline at end of file
+<?php
+ $attr_name = !empty($$attr_name)?$$attr_name:$attr_name;
+ $attr_readonly = ( $attr_readonly == 'true' );
+ $attr_default = ( $attr_default == 'true' );
+
+ if ( isset($$attr_name) )
+ $checked = isset($$$attr_name)&& $$$attr_name==true;
+ else
+ $checked = $attr_default;
+?><input type="checkbox" name="<?php echo $attr_name ?>" <?php if ($attr_readonly) echo ' disabled="disabled"' ?> value="1" <?php if( $checked ) echo 'checked="checked"' ?> />+
\ No newline at end of file