diff options
Diffstat (limited to 'apps/files_external/templates/settings.php')
-rw-r--r-- | apps/files_external/templates/settings.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 5e84fa8a252..80238666376 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -44,29 +44,32 @@ <?php if (isset($mount['options'])): ?> <?php foreach ($mount['options'] as $parameter => $value): ?> <?php if (isset($_['backends'][$mount['class']]['configuration'][$parameter])): ?> - <?php $placeholder = $_['backends'][$mount['class']]['configuration'][$parameter]; ?> - <?php if (strpos($placeholder, '*') !== false): ?> + <?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, '*') === 0): ?> <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)); ?>" /> - <?php elseif (strpos($placeholder, '!') !== false): ?> + <?php elseif (strpos($placeholder, '!') === 0): ?> <label><input type="checkbox" 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): ?> + <?php elseif (strpos($placeholder, '#') === 0): ?> <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); ?>" /> |