}
$cols = [
- 'name' => ['label' => 'volledige naam'],
- 'email' => ['label' => 'e-mailadres', 'type' => 'email'],
+ 'name' => [
+ 'label' => 'volledige naam',
+ 'explain' => "Alleen zichtbaar voor andere leden.",
+ ],
+ 'email' => [
+ 'label' => 'e-mailadres',
+ 'type' => 'email',
+ 'explain' => "Voor contact van of met deze site. Wij zullen dit nooit vrij- of doorgeven.",
+ ],
'avatar' => [
'label' => 'portretfoto',
'type' => 'file',
}
$cols = [
- 'login' => ['label' => 'login', 'value' => $user['name'], 'target' => NULL],
+ 'login' => [
+ 'label' => 'login',
+ 'value' => $user['name'],
+ 'target' => NULL,
+ 'pattern' => "[a-z0-9-]+",
+ ],
] + $cols;
if (isset($user['pass'])) {
?>
<form method="post" enctype="multipart/form-data">
- <p>
- Geef een e-mailadres op waarmee we u kunnen bereiken indien nodig.
- Wij zullen dit adres nooit vrij- of doorgeven.
- </p>
<ul class="grid">
<?php
foreach ($cols as $col => &$colconf) {
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
+ 'pattern' => @$colconf['pattern'] ?: FALSE,
];
if (@$colconf['type'] == 'file') {
$attrs['accept'] = "image/jpeg";
}
print ' />';
}
+ if (!empty($colconf['explain'])) {
+ printf(' <span>(%s)</span>', $colconf['explain']);
+ }
if ($hide) {
print '</span>';