Completed
Pull Request — master (#9946)
by Julius
27:29
created
apps/files_external/templates/settings.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@  discard block
 block discarded – undo
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', 'settings');
18
-	style('files_external', 'settings');
17
+    script('files_external', 'settings');
18
+    style('files_external', 'settings');
19 19
 
20
-	// load custom JS
21
-	foreach ($_['backends'] as $backend) {
22
-		/** @var Backend $backend */
23
-		$scripts = $backend->getCustomJs();
24
-		foreach ($scripts as $script) {
25
-			script('files_external', $script);
26
-		}
27
-	}
28
-	foreach ($_['authMechanisms'] as $authMechanism) {
29
-		/** @var AuthMechanism $authMechanism */
30
-		$scripts = $authMechanism->getCustomJs();
31
-		foreach ($scripts as $script) {
32
-			script('files_external', $script);
33
-		}
34
-	}
20
+    // load custom JS
21
+    foreach ($_['backends'] as $backend) {
22
+        /** @var Backend $backend */
23
+        $scripts = $backend->getCustomJs();
24
+        foreach ($scripts as $script) {
25
+            script('files_external', $script);
26
+        }
27
+    }
28
+    foreach ($_['authMechanisms'] as $authMechanism) {
29
+        /** @var AuthMechanism $authMechanism */
30
+        $scripts = $authMechanism->getCustomJs();
31
+        foreach ($scripts as $script) {
32
+            script('files_external', $script);
33
+        }
34
+    }
35 35
 
36
-	function writeParameterInput($parameter, $options, $classes = []) {
37
-		$value = '';
38
-		if (isset($options[$parameter->getName()])) {
39
-			$value = $options[$parameter->getName()];
40
-		}
41
-		$placeholder = $parameter->getText();
42
-		$is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL);
36
+    function writeParameterInput($parameter, $options, $classes = []) {
37
+        $value = '';
38
+        if (isset($options[$parameter->getName()])) {
39
+            $value = $options[$parameter->getName()];
40
+        }
41
+        $placeholder = $parameter->getText();
42
+        $is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL);
43 43
 
44
-		switch ($parameter->getType()) {
45
-		case DefinitionParameter::VALUE_PASSWORD: ?>
44
+        switch ($parameter->getType()) {
45
+        case DefinitionParameter::VALUE_PASSWORD: ?>
46 46
 			<?php if ($is_optional) { $classes[] = 'optional'; } ?>
47 47
 			<input type="password"
48 48
 				<?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?>
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 				placeholder="<?php p($placeholder); ?>"
52 52
 			/>
53 53
 			<?php
54
-			break;
55
-		case DefinitionParameter::VALUE_BOOLEAN: ?>
54
+            break;
55
+        case DefinitionParameter::VALUE_BOOLEAN: ?>
56 56
 			<?php $checkboxId = uniqid("checkbox_"); ?>
57 57
 			<div>
58 58
 			<label>
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 			</label>
67 67
 			</div>
68 68
 			<?php
69
-			break;
70
-		case DefinitionParameter::VALUE_HIDDEN: ?>
69
+            break;
70
+        case DefinitionParameter::VALUE_HIDDEN: ?>
71 71
 			<input type="hidden"
72 72
 				<?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?>
73 73
 				data-parameter="<?php p($parameter->getName()); ?>"
74 74
 				value="<?php p($value); ?>"
75 75
 			/>
76 76
 			<?php
77
-			break;
78
-		default: ?>
77
+            break;
78
+        default: ?>
79 79
 			<?php if ($is_optional) { $classes[] = 'optional'; } ?>
80 80
 			<input type="text"
81 81
 				<?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?>
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 				placeholder="<?php p($placeholder); ?>"
85 85
 			/>
86 86
 			<?php
87
-		}
88
-	}
87
+        }
88
+    }
89 89
 ?>
90 90
 
91 91
 <div id="emptycontent" class="hidden">
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 							<?php p($l->t('Add storage')); ?>
130 130
 						</option>
131 131
 						<?php
132
-							$sortedBackends = array_filter($_['backends'], function($backend) use ($_) {
133
-								return $backend->isVisibleFor($_['visibilityType']);
134
-							});
135
-							uasort($sortedBackends, function($a, $b) {
136
-								return strcasecmp($a->getText(), $b->getText());
137
-							});
138
-						?>
132
+                            $sortedBackends = array_filter($_['backends'], function($backend) use ($_) {
133
+                                return $backend->isVisibleFor($_['visibilityType']);
134
+                            });
135
+                            uasort($sortedBackends, function($a, $b) {
136
+                                return strcasecmp($a->getText(), $b->getText());
137
+                            });
138
+                        ?>
139 139
 						<?php foreach ($sortedBackends as $backend): ?>
140 140
 							<?php if ($backend->getDeprecateTo()) continue; // ignore deprecated backends ?>
141 141
 							<option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option>
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 
171 171
 		<p id="userMountingBackends"<?php if (!$_['allowUserMounting']): ?> class="hidden"<?php endif; ?>>
172 172
 			<?php
173
-				$userBackends = array_filter($_['backends'], function($backend) {
174
-					return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL);
175
-				});
176
-			?>
173
+                $userBackends = array_filter($_['backends'], function($backend) {
174
+                    return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL);
175
+                });
176
+            ?>
177 177
 			<?php $i = 0; foreach ($userBackends as $backend): ?>
178 178
 				<?php if ($deprecateTo = $backend->getDeprecateTo()): ?>
179 179
 					<input type="hidden" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" data-deprecate-to="<?php p($deprecateTo->getIdentifier()); ?>" />
Please login to merge, or discard this patch.