From 943688a66694cc3d97188c7b789207aa3ee8bfc2 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 9 Dec 2018 05:31:46 +0100 Subject: [PATCH] login/edit: option to override tag labels Sites can predefine elements of "values" with preferred label names instead of fallback to file names. --- login/edit.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/login/edit.php b/login/edit.php index e60cf59..88272e0 100644 --- a/login/edit.php +++ b/login/edit.php @@ -41,8 +41,8 @@ foreach ($cols as $col => &$colconf) { $tagname = pathinfo($tag, PATHINFO_BASENAME); $target = "$tag/{$user['name']}"; $val = file_exists($target); - $tagopt = &$colconf['values'][$tagname]; - $tagopt = ['value' => $val]; + $tagopt = &$colconf['values'][$tagname] ?: []; + $tagopt['value'] = $val; if (!is_writable($tag)) { continue; # locked tag directory } @@ -201,9 +201,9 @@ foreach ($cols as $col => &$colconf) { '' . '', "tags[$tag]", "tag-$tag", - $val['value'] ? ' checked' : '', + !empty($val['value']) ? ' checked' : '', isset($val['target']) ? '' : ' readonly', - ucfirst($tag) + @$val['label'] ?: ucfirst($tag) ); } } -- 2.30.0