];
foreach ($cols as $col => &$colconf) {
- $colpath = "{$user['dir']}/$col.txt";
+ $filetype = @$colconf['type'] == 'file' ? 'jpg' : 'txt';
+ $colpath = "{$user['dir']}/$col.$filetype";
if (file_exists($colpath)) {
- $colconf['value'] = @$colconf['type'] == 'file' ? '' :
+ $colconf['value'] = $filetype != 'txt' ? '' :
file_get_contents($colpath);
}
if (file_exists($user['dir']) and !is_writable($user['dir'])) {
foreach ($cols as $col => &$colconf) {
print "\t";
printf('<label for="%s">%s:</label> ', $col, ucfirst($colconf['label']));
+ if (@$colconf['type'] == 'file' and isset($colconf['value'])) {
+ printf('<img src="/%s" /><br />', $colconf['target']);
+ }
print "<input";
if (empty($colconf['target'])) print ' readonly';
printf(' type="%s" name="%s" id="%1$s" value="%s"',
$col,
htmlspecialchars(@$colconf['value'])
);
+ if (@$colconf['type'] == 'file') {
+ printf(' accept="%s"', 'image/jpeg');
+ }
print ' placeholder="Niet ingesteld"';
print " />";