@@ -17,7 +17,7 @@ |
||
| 17 | 17 | <tr> |
| 18 | 18 | <th id='headerName' class="hidden column-name"> |
| 19 | 19 | <div id="headerName-container"> |
| 20 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
| 20 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
| 21 | 21 | </div> |
| 22 | 22 | </th> |
| 23 | 23 | <th id="headerBackend" class="hidden column-backend"> |
@@ -1,47 +1,47 @@ 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"); |
|
| 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 | 15 | |
| 16 | - script('files_external', 'settings'); |
|
| 17 | - style('files_external', 'settings'); |
|
| 16 | + script('files_external', 'settings'); |
|
| 17 | + style('files_external', 'settings'); |
|
| 18 | 18 | |
| 19 | - // load custom JS |
|
| 20 | - foreach ($_['backends'] as $backend) { |
|
| 21 | - /** @var Backend $backend */ |
|
| 22 | - $scripts = $backend->getCustomJs(); |
|
| 23 | - foreach ($scripts as $script) { |
|
| 24 | - script('files_external', $script); |
|
| 25 | - } |
|
| 26 | - } |
|
| 27 | - foreach ($_['authMechanisms'] as $authMechanism) { |
|
| 28 | - /** @var AuthMechanism $authMechanism */ |
|
| 29 | - $scripts = $authMechanism->getCustomJs(); |
|
| 30 | - foreach ($scripts as $script) { |
|
| 31 | - script('files_external', $script); |
|
| 32 | - } |
|
| 33 | - } |
|
| 19 | + // load custom JS |
|
| 20 | + foreach ($_['backends'] as $backend) { |
|
| 21 | + /** @var Backend $backend */ |
|
| 22 | + $scripts = $backend->getCustomJs(); |
|
| 23 | + foreach ($scripts as $script) { |
|
| 24 | + script('files_external', $script); |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | + foreach ($_['authMechanisms'] as $authMechanism) { |
|
| 28 | + /** @var AuthMechanism $authMechanism */ |
|
| 29 | + $scripts = $authMechanism->getCustomJs(); |
|
| 30 | + foreach ($scripts as $script) { |
|
| 31 | + script('files_external', $script); |
|
| 32 | + } |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - function writeParameterInput($parameter, $options, $classes = []) { |
|
| 36 | - $value = ''; |
|
| 37 | - if (isset($options[$parameter->getName()])) { |
|
| 38 | - $value = $options[$parameter->getName()]; |
|
| 39 | - } |
|
| 40 | - $placeholder = $parameter->getText(); |
|
| 41 | - $is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL); |
|
| 35 | + function writeParameterInput($parameter, $options, $classes = []) { |
|
| 36 | + $value = ''; |
|
| 37 | + if (isset($options[$parameter->getName()])) { |
|
| 38 | + $value = $options[$parameter->getName()]; |
|
| 39 | + } |
|
| 40 | + $placeholder = $parameter->getText(); |
|
| 41 | + $is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL); |
|
| 42 | 42 | |
| 43 | - switch ($parameter->getType()) { |
|
| 44 | - case DefinitionParameter::VALUE_PASSWORD: ?> |
|
| 43 | + switch ($parameter->getType()) { |
|
| 44 | + case DefinitionParameter::VALUE_PASSWORD: ?> |
|
| 45 | 45 | <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
| 46 | 46 | <input type="password" |
| 47 | 47 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | placeholder="<?php p($placeholder); ?>" |
| 51 | 51 | /> |
| 52 | 52 | <?php |
| 53 | - break; |
|
| 54 | - case DefinitionParameter::VALUE_BOOLEAN: ?> |
|
| 53 | + break; |
|
| 54 | + case DefinitionParameter::VALUE_BOOLEAN: ?> |
|
| 55 | 55 | <?php $checkboxId = uniqid("checkbox_"); ?> |
| 56 | 56 | <div> |
| 57 | 57 | <label> |
@@ -65,16 +65,16 @@ discard block |
||
| 65 | 65 | </label> |
| 66 | 66 | </div> |
| 67 | 67 | <?php |
| 68 | - break; |
|
| 69 | - case DefinitionParameter::VALUE_HIDDEN: ?> |
|
| 68 | + break; |
|
| 69 | + case DefinitionParameter::VALUE_HIDDEN: ?> |
|
| 70 | 70 | <input type="hidden" |
| 71 | 71 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
| 72 | 72 | data-parameter="<?php p($parameter->getName()); ?>" |
| 73 | 73 | value="<?php p($value); ?>" |
| 74 | 74 | /> |
| 75 | 75 | <?php |
| 76 | - break; |
|
| 77 | - default: ?> |
|
| 76 | + break; |
|
| 77 | + default: ?> |
|
| 78 | 78 | <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
| 79 | 79 | <input type="text" |
| 80 | 80 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | placeholder="<?php p($placeholder); ?>" |
| 84 | 84 | /> |
| 85 | 85 | <?php |
| 86 | - } |
|
| 87 | - } |
|
| 86 | + } |
|
| 87 | + } |
|
| 88 | 88 | ?> |
| 89 | 89 | |
| 90 | 90 | <div id="emptycontent" class="hidden"> |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | <?php p($l->t('Add storage')); ?> |
| 129 | 129 | </option> |
| 130 | 130 | <?php |
| 131 | - $sortedBackends = array_filter($_['backends'], function($backend) use ($_) { |
|
| 132 | - return $backend->isVisibleFor($_['visibilityType']); |
|
| 133 | - }); |
|
| 134 | - uasort($sortedBackends, function($a, $b) { |
|
| 135 | - return strcasecmp($a->getText(), $b->getText()); |
|
| 136 | - }); |
|
| 137 | - ?> |
|
| 131 | + $sortedBackends = array_filter($_['backends'], function($backend) use ($_) { |
|
| 132 | + return $backend->isVisibleFor($_['visibilityType']); |
|
| 133 | + }); |
|
| 134 | + uasort($sortedBackends, function($a, $b) { |
|
| 135 | + return strcasecmp($a->getText(), $b->getText()); |
|
| 136 | + }); |
|
| 137 | + ?> |
|
| 138 | 138 | <?php foreach ($sortedBackends as $backend): ?> |
| 139 | 139 | <?php if ($backend->getDeprecateTo()) continue; // ignore deprecated backends ?> |
| 140 | 140 | <option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option> |
@@ -181,10 +181,10 @@ discard block |
||
| 181 | 181 | <p id="userMountingBackends"<?php if (!$_['allowUserMounting']): ?> class="hidden"<?php endif; ?>> |
| 182 | 182 | <?php p($l->t('Allow users to mount the following external storage')); ?><br /> |
| 183 | 183 | <?php |
| 184 | - $userBackends = array_filter($_['backends'], function($backend) { |
|
| 185 | - return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL); |
|
| 186 | - }); |
|
| 187 | - ?> |
|
| 184 | + $userBackends = array_filter($_['backends'], function($backend) { |
|
| 185 | + return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL); |
|
| 186 | + }); |
|
| 187 | + ?> |
|
| 188 | 188 | <?php $i = 0; foreach ($userBackends as $backend): ?> |
| 189 | 189 | <?php if ($deprecateTo = $backend->getDeprecateTo()): ?> |
| 190 | 190 | <input type="hidden" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" data-deprecate-to="<?php p($deprecateTo->getIdentifier()); ?>" /> |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | <h2><?php p($l->t('No external storage configured or you don\'t have the permission to configure them')); ?></h2> |
| 93 | 93 | </div> |
| 94 | 94 | |
| 95 | -<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> |
|
| 95 | +<form data-can-create="<?php echo $canCreateMounts ? 'true' : 'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled'] ? 'true' : 'false'; ?>"> |
|
| 96 | 96 | <h2 data-anchor-name="external-storage"><?php p($l->t('External storages')); ?></h2> |
| 97 | 97 | <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> |
| 98 | 98 | <table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'> |