diff options
author | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2014-03-20 18:27:40 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2014-03-20 18:27:40 +0000 |
commit | ed0c10a10b0b3a9d9d898a64461de707026cd6d3 (patch) | |
tree | 583a9044db30475f03a4b1ce7bb3ef272495820e /apps/files_external/templates | |
parent | 2c561c9c5072ce82e06bd5ab2c4ee81bc5d09d59 (diff) | |
download | nextcloud-server-ed0c10a10b0b3a9d9d898a64461de707026cd6d3.tar.gz nextcloud-server-ed0c10a10b0b3a9d9d898a64461de707026cd6d3.zip |
Enable the use of 'optional' on password fields
The logic has been changed, in that 'class="optional"' is applied to both
password and text types if the field begins with the optional market, '&'.
Diffstat (limited to 'apps/files_external/templates')
-rw-r--r-- | apps/files_external/templates/settings.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index de44d3c8644..8e9355dd8a5 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -44,9 +44,17 @@ <?php if (isset($mount['configuration'])): ?> <?php foreach ($mount['configuration'] as $parameter => $value): ?> <?php if (isset($_['backends'][$mount['class']]['configuration'][$parameter])): ?> - <?php $placeholder = $_['backends'][$mount['class']]['configuration'][$parameter]; ?> + <?php + $placeholder = $_['backends'][$mount['class']]['configuration'][$parameter]; + $is_optional = FALSE; + if (strpos($placeholder, '&') === 0) { + $is_optional = TRUE; + $placeholder = substr($placeholder, 1); + } + ?> <?php if (strpos($placeholder, '*') !== false): ?> <input type="password" + <?php if ($is_optional): ?> class="optional"<?php endif; ?> data-parameter="<?php p($parameter); ?>" value="<?php p($value); ?>" placeholder="<?php p(substr($placeholder, 1)); ?>" /> @@ -55,18 +63,13 @@ data-parameter="<?php p($parameter); ?>" <?php if ($value == 'true'): ?> checked="checked"<?php endif; ?> /><?php p(substr($placeholder, 1)); ?></label> - <?php elseif (strpos($placeholder, '&') !== false): ?> - <input type="text" - class="optional" - data-parameter="<?php p($parameter); ?>" - value="<?php p($value); ?>" - placeholder="<?php p(substr($placeholder, 1)); ?>" /> <?php elseif (strpos($placeholder, '#') !== false): ?> <input type="hidden" data-parameter="<?php p($parameter); ?>" value="<?php p($value); ?>" /> <?php else: ?> <input type="text" + <?php if ($is_optional): ?> class="optional"<?php endif; ?> data-parameter="<?php p($parameter); ?>" value="<?php p($value); ?>" placeholder="<?php p($placeholder); ?>" /> |