print "\t";
printf('<li><label for="%s">%s:</label>', $col, ucfirst($colconf['label']));
if (@$colconf['type'] == 'file' and isset($colconf['value'])) {
+ $target = $user['dir'] . '/' . $colconf['filename'];
printf('<a href="/%s"><img src="/thumb/%s/%s?%s" /></a><br />',
- $colconf['target'],
- 200, $colconf['target'], filemtime($colconf['target'])
+ $target,
+ 200, $target, filemtime($target)
);
}
);
}
}
- else {
+ elseif (@$colconf['type'] !== 'file' or isset($colconf['target'])) {
if (isset($cols[$col]['filter'])) {
list ($targetstr, $inputstr) = $cols[$col]['filter'];
$colconf['value'] = str_replace($targetstr, $inputstr, @$colconf['value']);
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
- 'pattern' => @$colconf['pattern'] ?: FALSE,
- 'size' => @$colconf['size'] ?: FALSE,
- ];
- if (@$colconf['type'] == 'file') {
- $attrs['accept'] = "image/jpeg";
- }
+ ] + (@$colconf['attr'] ?: []);
print '<input';
foreach ($attrs as $attr => $attrval) {