@@ -14,7 +14,10 @@ |
||
| 14 | 14 | <input type="submit" id="submitMaxUpload" |
| 15 | 15 | value="<?php p($l->t( 'Save' )); ?>"/> |
| 16 | 16 | <p><em><?php p($l->t('With PHP-FPM it might take 5 minutes for changes to be applied.')); ?></em></p> |
| 17 | - <?php else: ?> |
|
| 18 | - <p><em><?php p($l->t('Missing permissions to edit from here.')); ?></em></p> |
|
| 17 | + <?php else { |
|
| 18 | + : ?> |
|
| 19 | + <p><em><?php p($l->t('Missing permissions to edit from here.')); |
|
| 20 | +} |
|
| 21 | +?></em></p> |
|
| 19 | 22 | <?php endif; ?> |
| 20 | 23 | </div> |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | } elseif ($file->isMounted()) { |
| 76 | 76 | $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir-external'); |
| 77 | 77 | } |
| 78 | - }else{ |
|
| 78 | + } else{ |
|
| 79 | 79 | $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon($file->getMimetype()); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -41,44 +41,44 @@ |
||
| 41 | 41 | $is_optional = $parameter->isFlagSet(DefinitionParameter::FLAG_OPTIONAL); |
| 42 | 42 | |
| 43 | 43 | switch ($parameter->getType()) { |
| 44 | - case DefinitionParameter::VALUE_PASSWORD: ?> |
|
| 45 | - <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
|
| 46 | - <input type="password" |
|
| 44 | + case DefinitionParameter::VALUE_PASSWORD: ?> |
|
| 45 | + <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
|
| 46 | + <input type="password" |
|
| 47 | 47 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
| 48 | - data-parameter="<?php p($parameter->getName()); ?>" |
|
| 48 | + data-parameter="<?php p($parameter->getName()); ?>" |
|
| 49 | 49 | value="<?php p($value); ?>" |
| 50 | 50 | placeholder="<?php p($placeholder); ?>" |
| 51 | 51 | /> |
| 52 | 52 | <?php |
| 53 | - break; |
|
| 54 | - case DefinitionParameter::VALUE_BOOLEAN: ?> |
|
| 55 | - <?php $checkboxId = uniqid("checkbox_"); ?> |
|
| 53 | + break; |
|
| 54 | + case DefinitionParameter::VALUE_BOOLEAN: ?> |
|
| 55 | + <?php $checkboxId = uniqid("checkbox_"); ?> |
|
| 56 | 56 | <div> |
| 57 | 57 | <label> |
| 58 | 58 | <input type="checkbox" |
| 59 | 59 | id="<?php p($checkboxId); ?>" |
| 60 | 60 | <?php if (!empty($classes)): ?> class="checkbox <?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
| 61 | - data-parameter="<?php p($parameter->getName()); ?>" |
|
| 61 | + data-parameter="<?php p($parameter->getName()); ?>" |
|
| 62 | 62 | <?php if ($value === true): ?> checked="checked"<?php endif; ?> |
| 63 | - /> |
|
| 63 | + /> |
|
| 64 | 64 | <?php p($placeholder); ?> |
| 65 | 65 | </label> |
| 66 | 66 | </div> |
| 67 | 67 | <?php |
| 68 | - break; |
|
| 69 | - case DefinitionParameter::VALUE_HIDDEN: ?> |
|
| 70 | - <input type="hidden" |
|
| 68 | + break; |
|
| 69 | + case DefinitionParameter::VALUE_HIDDEN: ?> |
|
| 70 | + <input type="hidden" |
|
| 71 | 71 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
| 72 | - data-parameter="<?php p($parameter->getName()); ?>" |
|
| 72 | + data-parameter="<?php p($parameter->getName()); ?>" |
|
| 73 | 73 | value="<?php p($value); ?>" |
| 74 | 74 | /> |
| 75 | 75 | <?php |
| 76 | - break; |
|
| 77 | - default: ?> |
|
| 78 | - <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
|
| 79 | - <input type="text" |
|
| 76 | + break; |
|
| 77 | + default: ?> |
|
| 78 | + <?php if ($is_optional) { $classes[] = 'optional'; } ?> |
|
| 79 | + <input type="text" |
|
| 80 | 80 | <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> |
| 81 | - data-parameter="<?php p($parameter->getName()); ?>" |
|
| 81 | + data-parameter="<?php p($parameter->getName()); ?>" |
|
| 82 | 82 | value="<?php p($value); ?>" |
| 83 | 83 | placeholder="<?php p($placeholder); ?>" |
| 84 | 84 | /> |
@@ -96,7 +96,10 @@ discard block |
||
| 96 | 96 | <form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> |
| 97 | 97 | <h2 data-anchor-name="external-storage"><?php p($l->t('External storages')); ?></h2> |
| 98 | 98 | <p class="settings-hint"><?php p($l->t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow users to mount their own external storage services.')); ?></p> |
| 99 | - <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> |
|
| 99 | + <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) { |
|
| 100 | + print_unescaped(''.$_['dependencies'].''); |
|
| 101 | +} |
|
| 102 | +?> |
|
| 100 | 103 | <table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'> |
| 101 | 104 | <thead> |
| 102 | 105 | <tr> |
@@ -105,7 +108,10 @@ discard block |
||
| 105 | 108 | <th><?php p($l->t('External storage')); ?></th> |
| 106 | 109 | <th><?php p($l->t('Authentication')); ?></th> |
| 107 | 110 | <th><?php p($l->t('Configuration')); ?></th> |
| 108 | - <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN) print_unescaped('<th>'.$l->t('Available for').'</th>'); ?> |
|
| 111 | + <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN) { |
|
| 112 | + print_unescaped('<th>'.$l->t('Available for').'</th>'); |
|
| 113 | +} |
|
| 114 | +?> |
|
| 109 | 115 | <th> </th> |
| 110 | 116 | <th> </th> |
| 111 | 117 | <th> </th> |
@@ -138,7 +144,10 @@ discard block |
||
| 138 | 144 | }); |
| 139 | 145 | ?> |
| 140 | 146 | <?php foreach ($sortedBackends as $backend): ?> |
| 141 | - <?php if ($backend->getDeprecateTo()) continue; // ignore deprecated backends ?> |
|
| 147 | + <?php if ($backend->getDeprecateTo()) { |
|
| 148 | + continue; |
|
| 149 | +} |
|
| 150 | +// ignore deprecated backends ?> |
|
| 142 | 151 | <option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option> |
| 143 | 152 | <?php endforeach; ?> |
| 144 | 153 | </select> |
@@ -163,7 +172,10 @@ discard block |
||
| 163 | 172 | |
| 164 | 173 | <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN): ?> |
| 165 | 174 | <input type="checkbox" name="allowUserMounting" id="allowUserMounting" class="checkbox" |
| 166 | - value="1" <?php if ($_['allowUserMounting']) print_unescaped(' checked="checked"'); ?> /> |
|
| 175 | + value="1" <?php if ($_['allowUserMounting']) { |
|
| 176 | + print_unescaped(' checked="checked"'); |
|
| 177 | +} |
|
| 178 | +?> /> |
|
| 167 | 179 | <label for="allowUserMounting"><?php p($l->t('Allow users to mount external storage')); ?></label> <span id="userMountingMsg" class="msg"></span> |
| 168 | 180 | |
| 169 | 181 | <p id="userMountingBackends"<?php if (!$_['allowUserMounting']): ?> class="hidden"<?php endif; ?>> |
@@ -175,8 +187,14 @@ discard block |
||
| 175 | 187 | <?php $i = 0; foreach ($userBackends as $backend): ?> |
| 176 | 188 | <?php if ($deprecateTo = $backend->getDeprecateTo()): ?> |
| 177 | 189 | <input type="hidden" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" data-deprecate-to="<?php p($deprecateTo->getIdentifier()); ?>" /> |
| 178 | - <?php else: ?> |
|
| 179 | - <input type="checkbox" id="allowUserMountingBackends<?php p($i); ?>" class="checkbox" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" <?php if ($backend->isVisibleFor(BackendService::VISIBILITY_PERSONAL)) print_unescaped(' checked="checked"'); ?> /> |
|
| 190 | + <?php else { |
|
| 191 | + : ?> |
|
| 192 | + <input type="checkbox" id="allowUserMountingBackends<?php p($i); |
|
| 193 | +} |
|
| 194 | +?>" class="checkbox" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" <?php if ($backend->isVisibleFor(BackendService::VISIBILITY_PERSONAL)) { |
|
| 195 | + print_unescaped(' checked="checked"'); |
|
| 196 | +} |
|
| 197 | +?> /> |
|
| 180 | 198 | <label for="allowUserMountingBackends<?php p($i); ?>"><?php p($backend->getText()); ?></label> <br /> |
| 181 | 199 | <?php endif; ?> |
| 182 | 200 | <?php $i++; ?> |
@@ -93,8 +93,7 @@ |
||
| 93 | 93 | public function unlink($path) { |
| 94 | 94 | if ($this->is_dir($path)) { |
| 95 | 95 | return $this->rmdir($path); |
| 96 | - } |
|
| 97 | - else { |
|
| 96 | + } else { |
|
| 98 | 97 | $url = $this->constructUrl($path); |
| 99 | 98 | $result = unlink($url); |
| 100 | 99 | clearstatcache(true, $url); |
@@ -62,18 +62,18 @@ |
||
| 62 | 62 | $placeholder = substr($placeholder, 1); |
| 63 | 63 | } |
| 64 | 64 | switch ($placeholder[0]) { |
| 65 | - case '!': |
|
| 66 | - $type = DefinitionParameter::VALUE_BOOLEAN; |
|
| 67 | - $placeholder = substr($placeholder, 1); |
|
| 68 | - break; |
|
| 69 | - case '*': |
|
| 70 | - $type = DefinitionParameter::VALUE_PASSWORD; |
|
| 71 | - $placeholder = substr($placeholder, 1); |
|
| 72 | - break; |
|
| 73 | - case '#': |
|
| 74 | - $type = DefinitionParameter::VALUE_HIDDEN; |
|
| 75 | - $placeholder = substr($placeholder, 1); |
|
| 76 | - break; |
|
| 65 | + case '!': |
|
| 66 | + $type = DefinitionParameter::VALUE_BOOLEAN; |
|
| 67 | + $placeholder = substr($placeholder, 1); |
|
| 68 | + break; |
|
| 69 | + case '*': |
|
| 70 | + $type = DefinitionParameter::VALUE_PASSWORD; |
|
| 71 | + $placeholder = substr($placeholder, 1); |
|
| 72 | + break; |
|
| 73 | + case '#': |
|
| 74 | + $type = DefinitionParameter::VALUE_HIDDEN; |
|
| 75 | + $placeholder = substr($placeholder, 1); |
|
| 76 | + break; |
|
| 77 | 77 | } |
| 78 | 78 | $this->addParameter((new DefinitionParameter($name, $placeholder)) |
| 79 | 79 | ->setType($type) |
@@ -119,8 +119,9 @@ |
||
| 119 | 119 | |
| 120 | 120 | // Only handling xml |
| 121 | 121 | $contentType = $request->getHeader('Content-Type'); |
| 122 | - if (strpos($contentType, 'application/xml') === false && strpos($contentType, 'text/xml') === false) |
|
| 123 | - return; |
|
| 122 | + if (strpos($contentType, 'application/xml') === false && strpos($contentType, 'text/xml') === false) { |
|
| 123 | + return; |
|
| 124 | + } |
|
| 124 | 125 | |
| 125 | 126 | // Making sure the node exists |
| 126 | 127 | try { |
@@ -245,7 +245,9 @@ |
||
| 245 | 245 | function httpGet(RequestInterface $request, ResponseInterface $response) { |
| 246 | 246 | // Only handle valid files |
| 247 | 247 | $node = $this->tree->getNodeForPath($request->getPath()); |
| 248 | - if (!($node instanceof IFile)) return; |
|
| 248 | + if (!($node instanceof IFile)) { |
|
| 249 | + return; |
|
| 250 | + } |
|
| 249 | 251 | |
| 250 | 252 | // adds a 'Content-Disposition: attachment' header in case no disposition |
| 251 | 253 | // header has been set before |
@@ -38,7 +38,9 @@ |
||
| 38 | 38 | public function getCurrentUserPrincipals() { |
| 39 | 39 | $principalV2 = $this->getCurrentUserPrincipal(); |
| 40 | 40 | |
| 41 | - if (is_null($principalV2)) return []; |
|
| 41 | + if (is_null($principalV2)) { |
|
| 42 | + return []; |
|
| 43 | + } |
|
| 42 | 44 | |
| 43 | 45 | $principalV1 = $this->convertPrincipal($principalV2, false); |
| 44 | 46 | return array_merge( |
@@ -745,7 +745,9 @@ |
||
| 745 | 745 | $stmt->execute([ $addressBookId ]); |
| 746 | 746 | $currentToken = $stmt->fetchColumn(0); |
| 747 | 747 | |
| 748 | - if (is_null($currentToken)) return null; |
|
| 748 | + if (is_null($currentToken)) { |
|
| 749 | + return null; |
|
| 750 | + } |
|
| 749 | 751 | |
| 750 | 752 | $result = [ |
| 751 | 753 | 'syncToken' => $currentToken, |