summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--php/admin/include/form.class.php40
2 files changed, 28 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index bc04d0b..a41f6db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-05-24 Gunnar Wrobel <p@rdus.de>
+ * php/admin/include/form.class.php:
+
+ Fixed
+ kolab/issue1610 (https://intevation.de/roundup/kolab/issue1610)
+
* php/admin/templates/page.tpl.in:
* www/admin/print.css:
diff --git a/php/admin/include/form.class.php b/php/admin/include/form.class.php
index 8de1437..bfd76f1 100644
--- a/php/admin/include/form.class.php
+++ b/php/admin/include/form.class.php
@@ -97,12 +97,13 @@ class KolabForm {
case 'input':
case 'text':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><label>'.$value['name'].'</label></td>';
$str .= '<td><p class="ctrl">'.MySmarty::htmlentities($value['value']).'</p><input name="'
.$key.'" type="hidden" value="'.MySmarty::htmlentities($value['value']).'" /></td>';
} else {
- $str .= '<td><input name="'.$key.'" type="'.$value['type'].'" value="'.MySmarty::htmlentities($value['value']).'" '
+ $str .= '<td><label for="'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><input name="'.$key.'" id="'.$key.'" type="'.$value['type'].'" value="'.MySmarty::htmlentities($value['value']).'" '
.MySmarty::htmlentities($value['attrs']).' size="'.$size.'" /></td>';
}
$str .= '<td>'.KolabForm::comment_helper($value).'</td>';
@@ -110,7 +111,6 @@ class KolabForm {
break;
case 'email':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
if( strpos($value['value'],'@')===false ) {
$uname = $value['value'];
$domain = '';
@@ -122,13 +122,14 @@ class KolabForm {
MySmarty::htmlentities($uname).'" /><input name="domain_'.$key.'" type="hidden" value="'.
MySmarty::htmlentities($domain).'" /></td>';
} else {
- $str .= '<td><input name="user_'.$key.'" type="text" value="'.MySmarty::htmlentities($uname).'" '
+ $str .= '<td><label for="user_'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><input name="user_'.$key.'" id="user_'.$key.'" type="text" value="'.MySmarty::htmlentities($uname).'" '
.$value['attrs'].' size="'.($size-40).'" />';
if( count($value['domains']) == 1 ) {
$str .= '<input name="domain_'.$key.'" type="hidden" value="'.MySmarty::htmlentities($value['domains'][0]).'" />';
$str .= '<span class="ctrl">@'.MySmarty::htmlentities($value['domains'][0]).'</span></td>';
} else {
- $str .= '@<select name="domain_'.$key.'" '.$value['attrs']." >\n";
+ $str .= '<label for="domain_'.$key.'">@</label><select name="domain_'.$key.'" id="domain_'.$key.'" '.$value['attrs']." >\n";
foreach( $value['domains'] as $dom ) {
if( $dom == $domain ) $s = 'selected="selected"';
else $s = '';
@@ -150,29 +151,31 @@ class KolabForm {
break;
case 'textarea':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><label>'.$value['name'].'</label></td>';
$str .= '<td><p class="ctrl">'.MySmarty::htmlentities($value['value']).'</p></td>';
} else {
- $str .= '<td><textarea name="'.$key.'" rows="5" cols="'.$size.'" '.$value['attrs'].' onkeypress="javascript:textareakeypress()">'.MySmarty::htmlentities($value['value']).'</textarea></td>';
+ $str .= '<td><label for="'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><textarea name="'.$key.'" id="'.$key.'" rows="5" cols="'.$size.'" '.$value['attrs'].' onkeypress="javascript:textareakeypress()">'.MySmarty::htmlentities($value['value']).'</textarea></td>';
}
$str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'checkbox':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><label>'.$value['name'].'</label></td>';
$str .= '<td><span class="ctrl">'.($value['value']?_('Yes'):_('No')).'</span></td>';
} else {
- $str .= '<td><input name="'.$key.'" type="'.$value['type'].'" value="on" '.($value['value']?'checked':'').' '.$value['attrs'].' /></td>';
+ $str .= '<td><label for="'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><input name="'.$key.'" id="'.$key.'" type="'.$value['type'].'" value="on" '.($value['value']?'checked':'').' '.$value['attrs'].' /></td>';
}
$str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'checklist':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
+ $str .= '<td><label>'.$value['name'].'</label></td>';
if( ereg( 'readonly', $value['attrs'] ) ) {
$str .= '<td><span class="ctrl">'.(join('<br/>',$value['options'])).'</span></td>';
} else {
@@ -191,12 +194,13 @@ class KolabForm {
break;
case 'select':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><label>'.$value['name'].'</label></td>';
$str .= '<td><p class="ctrl">'.MySmarty::htmlentities($value['options'][$value['value']]).
'<input type="hidden" name="'.$key.'" value="'.MySmarty::htmlentities($value['value']).'" /></p></td>';
} else {
- $str .= '<td><select name="'.$key.'" '.$value['attrs'].' >'."\n";
+ $str .= '<td><label for="'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><select name="'.$key.'" id="'.$key.'" '.$value['attrs'].' >'."\n";
for( $i = 0; $i < count($value['options']); ++$i) {
if( $i == $value['value'] ) $s = 'selected="selected"';
@@ -211,15 +215,16 @@ class KolabForm {
break;
case 'foldertypeselect':
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
$entries = array ( '' => _('Unspecified'), 'mail' => _('Mails'), 'task' => _('Tasks'),
'journal' => _('Journals'), 'event' => _('Events'),
'contact' => _('Contacts'), 'note' => _('Notes'));
if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><label>'.$value['name'].'</label></td>';
$str .= '<td><p class="ctrl">'.MySmarty::htmlentities($entries[$value['value']]).
'<input type="hidden" name="'.$key.'" value="'.MySmarty::htmlentities($value['value']).'" /></p></td>';
} else {
- $str .= '<td><select name="'.$key.'" '.$value['attrs'].' >'."\n";
+ $str .= '<td><label for="'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><select name="'.$key.'" id="'.$key.'" '.$value['attrs'].' >'."\n";
foreach ($entries as $id => $title) {
if ( $value['value'] == $id )
$s = 'selected="selected"';
@@ -236,11 +241,12 @@ class KolabForm {
break;
case 'aclselect': // Special Kolab entry for ACLs
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
if( ereg( 'readonly', $value['attrs'] ) ) {
+ $str .= '<td><label>'.$value['name'].'</label></td>';
if( $value['user'] ) $str .= '<td><span class="ctrl">'.MySmarty::htmlentities($value['user']).'</span> <span class="ctrl">'.$value['perm'].'</span></td>';
} else {
- $str .= '<td><input name="user_'.$key.'" type="text" size="'.($size-15).'" value="'
+ $str .= '<td><label for="user_'.$key.'">'.$value['name'].'</label></td>';
+ $str .= '<td><input name="user_'.$key.'" id="user_'.$key.'" type="'.$value['type'].'" size="'.($size-15).'" value="'
.MySmarty::htmlentities($value['user']).'" '.$value['attrs'].' />';
$str .= '<select name="perm_'.$key.'">'."\n";
if( $value['perm'] ) $selected_perm = $value['perm'];
@@ -269,7 +275,7 @@ class KolabForm {
debug("resourcepolicy");
$ro = ereg( 'readonly', $value['attrs'] );
$str .= '<tr>';
- $str .= '<td>'.$value['name'].'</td>';
+ $str .= '<td><label>'.$value['name'].'</label></td>';
$str .= '<td>';
$str .= '<table>';
$i = 0;