@@ -1,51 +1,51 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - use \OCA\Files_External\Lib\Backend\Backend; |
|
| 3 | - use \OCA\Files_External\Lib\Auth\AuthMechanism; |
|
| 4 | - use \OCA\Files_External\Lib\DefinitionParameter; |
|
| 5 | - use \OCA\Files_External\Service\BackendService; |
|
| 2 | + use \OCA\Files_External\Lib\Backend\Backend; |
|
| 3 | + use \OCA\Files_External\Lib\Auth\AuthMechanism; |
|
| 4 | + use \OCA\Files_External\Lib\DefinitionParameter; |
|
| 5 | + use \OCA\Files_External\Service\BackendService; |
|
| 6 | 6 | |
| 7 | - $canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || $_['allowUserMounting']; |
|
| 7 | + $canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || $_['allowUserMounting']; |
|
| 8 | 8 | |
| 9 | - $l->t("Enable encryption"); |
|
| 10 | - $l->t("Enable previews"); |
|
| 11 | - $l->t("Enable sharing"); |
|
| 12 | - $l->t("Check for changes"); |
|
| 13 | - $l->t("Never"); |
|
| 14 | - $l->t("Once every direct access"); |
|
| 15 | - $l->t('Read only'); |
|
| 9 | + $l->t("Enable encryption"); |
|
| 10 | + $l->t("Enable previews"); |
|
| 11 | + $l->t("Enable sharing"); |
|
| 12 | + $l->t("Check for changes"); |
|
| 13 | + $l->t("Never"); |
|
| 14 | + $l->t("Once every direct access"); |
|
| 15 | + $l->t('Read only'); |
|
| 16 | 16 | |
| 17 | - script('files_external', [ |
|
| 18 | - 'settings', |
|
| 19 | - 'templates' |
|
| 20 | - ]); |
|
| 21 | - style('files_external', 'settings'); |
|
| 17 | + script('files_external', [ |
|
| 18 | + 'settings', |
|
| 19 | + 'templates' |
|
| 20 | + ]); |
|
| 21 | + style('files_external', 'settings'); |
|
| 22 | 22 | |
| 23 | - // load custom JS |
|
| 24 | - foreach ($_['backends'] as $backend) { |
|
| 25 | - /** @var Backend $backend */ |
|
| 26 | - $scripts = $backend->getCustomJs(); |
|
| 27 | - foreach ($scripts as $script) { |
|
| 28 | - script('files_external', $script); |
|
| 29 | - } |
|
| 30 | - } |
|
| 31 | - foreach ($_['authMechanisms'] as $authMechanism) { |
|
| 32 | - /** @var AuthMechanism $authMechanism */ |
|
| 33 | - $scripts = $authMechanism->getCustomJs(); |
|
| 34 | - foreach ($scripts as $script) { |
|
| 35 | - script('files_external', $script); |
|
| 36 | - } |
|
| 37 | - } |
|
| 23 | + // load custom JS |
|
| 24 | + foreach ($_['backends'] as $backend) { |
|
| 25 | + /** @var Backend $backend */ |
|
| 26 | + $scripts = $backend->getCustomJs(); |
|
| 27 | + foreach ($scripts as $script) { |
|
| 28 | + script('files_external', $script); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | + foreach ($_['authMechanisms'] as $authMechanism) { |
|
| 32 | + /** @var AuthMechanism $authMechanism */ |
|
| 33 | + $scripts = $authMechanism->getCustomJs(); |
|
| 34 | + foreach ($scripts as $script) { |
|
| 35 | + script('files_external', $script); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - function writeParameterInput($parameter, $options, $classes = []) { |
|
| 40 | - $value = ''; |
|
| 41 | - if (isset($options[$parameter->getName()])) { |
|
| 42 | - $value = $options[$parameter->getName()]; |
|
| 43 | - } |
|
| 44 | - $placeholder = $parameter->getText(); |
|
| 45 | - $is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL); |
|
| 39 | + function writeParameterInput($parameter, $options, $classes = []) { |
|
| 40 | + $value = ''; |
|
| 41 | + if (isset($options[$parameter->getName()])) { |
|
| 42 | + $value = $options[$parameter->getName()]; |
|
| 43 | + } |
|
| 44 | + $placeholder = $parameter->getText(); |
|
| 45 | + $is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL); |
|
| 46 | 46 | |
| 47 | - switch ($parameter->getType()) { |
|
| 48 | - case DefinitionParameter::VALUE_PASSWORD: ?> |
|
| 47 | + switch ($parameter->getType()) { |
|
| 48 | + case DefinitionParameter::VALUE_PASSWORD: ?> |
|
| 49 | 49 | <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
| 50 | 50 | <input type="password" |
| 51 | 51 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | placeholder="<?php p($placeholder); ?>" |
| 55 | 55 | /> |
| 56 | 56 | <?php |
| 57 | - break; |
|
| 58 | - case DefinitionParameter::VALUE_BOOLEAN: ?> |
|
| 57 | + break; |
|
| 58 | + case DefinitionParameter::VALUE_BOOLEAN: ?> |
|
| 59 | 59 | <?php $checkboxId = uniqid("checkbox_"); ?> |
| 60 | 60 | <div> |
| 61 | 61 | <label> |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | </label> |
| 70 | 70 | </div> |
| 71 | 71 | <?php |
| 72 | - break; |
|
| 73 | - case DefinitionParameter::VALUE_HIDDEN: ?> |
|
| 72 | + break; |
|
| 73 | + case DefinitionParameter::VALUE_HIDDEN: ?> |
|
| 74 | 74 | <input type="hidden" |
| 75 | 75 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
| 76 | 76 | data-parameter="<?php p($parameter->getName()); ?>" |
| 77 | 77 | value="<?php p($value); ?>" |
| 78 | 78 | /> |
| 79 | 79 | <?php |
| 80 | - break; |
|
| 81 | - default: ?> |
|
| 80 | + break; |
|
| 81 | + default: ?> |
|
| 82 | 82 | <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
| 83 | 83 | <input type="text" |
| 84 | 84 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | placeholder="<?php p($placeholder); ?>" |
| 88 | 88 | /> |
| 89 | 89 | <?php |
| 90 | - } |
|
| 91 | - } |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | 92 | ?> |
| 93 | 93 | |
| 94 | 94 | <div id="emptycontent" class="hidden"> |
@@ -133,13 +133,13 @@ discard block |
||
| 133 | 133 | <?php p($l->t('Add storage')); ?> |
| 134 | 134 | </option> |
| 135 | 135 | <?php |
| 136 | - $sortedBackends = array_filter($_['backends'], function($backend) use ($_) { |
|
| 137 | - return $backend->isVisibleFor($_['visibilityType']); |
|
| 138 | - }); |
|
| 139 | - uasort($sortedBackends, function($a, $b) { |
|
| 140 | - return strcasecmp($a->getText(), $b->getText()); |
|
| 141 | - }); |
|
| 142 | - ?> |
|
| 136 | + $sortedBackends = array_filter($_['backends'], function($backend) use ($_) { |
|
| 137 | + return $backend->isVisibleFor($_['visibilityType']); |
|
| 138 | + }); |
|
| 139 | + uasort($sortedBackends, function($a, $b) { |
|
| 140 | + return strcasecmp($a->getText(), $b->getText()); |
|
| 141 | + }); |
|
| 142 | + ?> |
|
| 143 | 143 | <?php foreach ($sortedBackends as $backend): ?> |
| 144 | 144 | <?php if ($backend->getDeprecateTo()) continue; // ignore deprecated backends ?> |
| 145 | 145 | <option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option> |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | <p id="userMountingBackends"<?php if (!$_['allowUserMounting']): ?> class="hidden"<?php endif; ?>> |
| 173 | 173 | <?php |
| 174 | - $userBackends = array_filter($_['backends'], function($backend) { |
|
| 175 | - return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL); |
|
| 176 | - }); |
|
| 177 | - ?> |
|
| 174 | + $userBackends = array_filter($_['backends'], function($backend) { |
|
| 175 | + return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL); |
|
| 176 | + }); |
|
| 177 | + ?> |
|
| 178 | 178 | <?php $i = 0; foreach ($userBackends as $backend): ?> |
| 179 | 179 | <?php if ($deprecateTo = $backend->getDeprecateTo()): ?> |
| 180 | 180 | <input type="hidden" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" data-deprecate-to="<?php p($deprecateTo->getIdentifier()); ?>" /> |