if (strpos($this->type,'date') !== false) return 'date';
}
+ public function htmlYesNo($checked_value) {
+
+ $s_no = $checked = ' checked="checked"';
+ if ( ( $s_yes = preg_match('/^(1|yes|on|true)/i',$checked_value) ? $checked : '' ) != '' ) $s_no = '';
+
+ $t1 = 'span'; $t2 = "</$t1>"; $t1 = "<$t1>";
+ return $t1
+ .'Yes <input type="radio" name="'.$this->name.'" value="1"'.$s_yes.'>'
+ .'No <input type="radio" name="'.$this->name.'" value="0"'.$s_no.'>'
+ .$t2;
+
+ }
+
public function html_edit($value,$type=null) {
$size = ($this->size() and is_scalar($this->size())) ? $this->size() : 0;
if ($this->extras) {
$html = '<span class="extra" id="'.$this->name.'">'.$this->out($value).'</span>';
- } elseif (strpos($this->type,'Zbool') !== false) {
- $html .= '<span>Yes</span><input type="checkbox" name="'.$this->name.'" value="1">';
- $html .= '<span>No</span><input type="checkbox" name="'.$this->name.'" value="0">';
+ } elseif (strpos($this->type,'bool') !== false) {
+ $html .= $this->htmlYesNo($value);
} else {
$html = '<'.$tag
form label,
form input,
form select {
- vertical-align: middle;
+ vertical-align: top;
margin: 0.2em 0.4em 0.2em 0;
}
border-right: none;
}
-form.menu select:focus {
- max-width: auto;
-}
-form.menu select {
- max-width: 20%;
-}
+form.menu select:focus { max-width: auto; }
-form.menu .criterias input[type=text]:focus {
- width: auto;
-}
-form.menu .criterias input[type=text] {
- width: 4em;
-}
-/*
-form.menu .criterias label {
- width: 60%;
- display: inline-block;
-}
-form.menu .criterias input {
- width: 30%;
- display: inline-block;
-}
-*/
+form.menu select { max-width: 20%; }
+
+form.menu .criterias input[type=text]:focus { width: auto; }
+form.menu .criterias input[type=text] { width: 4em; }
/*
EDIT PAGE
margin-right: 1em;
vertical-align: top;
}
+
form.edit .fields .label span {
width: 54%;
display: inline-block;
text-align: left;
+ vertical-align: middle;
}
-form.edit .fields input, form.edit .fields textarea, form.edit .fields select {
+/*
+input[type='text'],
+input[type='password'],
+input[type='date'],
+input[type='email'],
+input[type='url'],
+input[type='']
+*/
+form.edit .fields input[size],
+form.edit .fields textarea, form.edit .fields select {
width: 65%;
}
-
-form.edit .fields label {
- width: 25%;
- text-align: right;
- display: inline-block;
- margin-right: 1em;
- vertical-align: top;
-}
-
-form.edit .fields .label span {
- width: 54%;
- display: inline-block;
- text-align: left;
-}
-
/*
form.edit input[type=checkbox] {
text-align: left;