summaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
authorSteffen Hansen <steffen@kdab.com>2006-12-08 22:02:35 (GMT)
committerSteffen Hansen <steffen@kdab.com>2006-12-08 22:02:35 (GMT)
commitc9e14bf07cd2924d6b3b6132b8daebe1da8d95b3 (patch)
tree1036fe98db90477128a7def786482f6a8df00ebb /php
parent5f72d471dbf1a9dae6272b18811b6c5266dcc250 (diff)
downloadkolab-webadmin-c9e14bf07cd2924d6b3b6132b8daebe1da8d95b3.tar.gz
Fix for issue1418 (Field customisation issue)
Diffstat (limited to 'php')
-rw-r--r--php/admin/include/form.class.php30
1 files changed, 22 insertions, 8 deletions
diff --git a/php/admin/include/form.class.php b/php/admin/include/form.class.php
index acd9fa7..a24a1c9 100644
--- a/php/admin/include/form.class.php
+++ b/php/admin/include/form.class.php
@@ -44,8 +44,21 @@ class KolabForm {
if( !isset( $value['attrs'] ) ) $this->entries[$key]['attrs'] = '';
}
}
+
+ /*private*/function comment_helper( &$value ) {
+ $ast = '';
+ if( isset($value['validation'])){
+ if( is_array( $value['validation'] ) && in_array( 'notempty', $value['validation']) ) {
+ $ast = '<span class="required_asterisk">*</span> ';
+ } else if( $value['validation'] == 'notempty' ) {
+ $ast = '<span class="required_asterisk">*</span> ';
+ }
+ }
+ return $ast.$value['comment'];
+ }
function outputForm() {
+ debug_var_dump($this->entries);
$str = '<div class="contentform">';
/*
if( count( $this->errors ) > 0 ) {
@@ -83,7 +96,7 @@ class KolabForm {
$str .= '<td><input name="'.$key.'" type="'.$value['type'].'" value="'.MySmarty::htmlentities($value['value']).'" '
.MySmarty::htmlentities($value['attrs']).' size="'.$size.'" /></td>';
}
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'email':
@@ -116,14 +129,14 @@ class KolabForm {
$str .= '</td>';
}
}
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'comment':
$str .= '<tr>';
$str .= '<td>'.$value['name'].'</td>';
$str .= '<td>'.$value['value'].'</td>';
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'textarea':
@@ -134,7 +147,7 @@ class KolabForm {
} else {
$str .= '<td><textarea name="'.$key.'" rows="5" cols="'.$size.'" '.$value['attrs'].' onkeypress="javascript:textareakeypress()">'.MySmarty::htmlentities($value['value']).'</textarea></td>';
}
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'checkbox':
@@ -145,7 +158,7 @@ class KolabForm {
} else {
$str .= '<td><input name="'.$key.'" type="'.$value['type'].'" value="on" '.($value['value']?'checked':'').' '.$value['attrs'].' /></td>';
}
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'checklist':
@@ -184,7 +197,7 @@ class KolabForm {
$str .= '</select>';
$str .= '</td>';
}
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'foldertypeselect':
@@ -240,7 +253,7 @@ class KolabForm {
$str .= '</select>';
$str .= '</td>';
}
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
case 'resourcepolicy': // Special Kolab entry for group/resource policies
@@ -290,7 +303,7 @@ class KolabForm {
}
}
$str .= '</table></td>';
- $str .= '<td>'.$value['comment'].'</td>';
+ $str .= '<td>'.KolabForm::comment_helper($value).'</td>';
$str .= '</tr>'."\n";
break;
}
@@ -307,6 +320,7 @@ class KolabForm {
}
}
$str .= '</form>';
+ $str .= '<div class="required_asterisk">'._('* Required field.').'</div>';
$str .= '</div>';
return $str;
}