git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
login/edit: generic setup of input attributes
[minimedit.git]
/
login
/
edit.php
diff --git
a/login/edit.php
b/login/edit.php
index 1d29b03d203fec26440e5213521ae6774aa7f3e9..99afb13a62b745cfe08068c340815aa480cb1ff4 100644
(file)
--- a/
login/edit.php
+++ b/
login/edit.php
@@
-173,9
+173,10
@@
foreach ($cols as $col => &$colconf) {
print "\t";
printf('<li><label for="%s">%s:</label>', $col, ucfirst($colconf['label']));
if (@$colconf['type'] == 'file' and isset($colconf['value'])) {
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 />',
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
)
);
}
);
}
@@
-203,7
+204,7
@@
foreach ($cols as $col => &$colconf) {
);
}
}
);
}
}
- else {
+ else
if (@$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']);
if (isset($cols[$col]['filter'])) {
list ($targetstr, $inputstr) = $cols[$col]['filter'];
$colconf['value'] = str_replace($targetstr, $inputstr, @$colconf['value']);
@@
-216,12
+217,7
@@
foreach ($cols as $col => &$colconf) {
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
'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) {
print '<input';
foreach ($attrs as $attr => $attrval) {