@@ -2,17 +2,17 @@ |
||
| 2 | 2 | |
| 3 | 3 | <div class="section"> |
| 4 | 4 | <h2><?php p($l->t('File handling')); ?></h2> |
| 5 | - <label for="maxUploadSize"><?php p($l->t( 'Maximum upload size' )); ?> </label> |
|
| 5 | + <label for="maxUploadSize"><?php p($l->t('Maximum upload size')); ?> </label> |
|
| 6 | 6 | <span id="maxUploadSizeSettingsMsg" class="msg"></span> |
| 7 | 7 | <br /> |
| 8 | - <input type="text" name='maxUploadSize' id="maxUploadSize" value='<?php p($_['uploadMaxFilesize']) ?>' <?php if(!$_['uploadChangable']) { p('disabled'); } ?> /> |
|
| 9 | - <?php if($_['displayMaxPossibleUploadSize']):?> |
|
| 8 | + <input type="text" name='maxUploadSize' id="maxUploadSize" value='<?php p($_['uploadMaxFilesize']) ?>' <?php if (!$_['uploadChangable']) { p('disabled'); } ?> /> |
|
| 9 | + <?php if ($_['displayMaxPossibleUploadSize']):?> |
|
| 10 | 10 | (<?php p($l->t('max. possible: ')); p($_['maxPossibleUploadSize']) ?>) |
| 11 | - <?php endif;?> |
|
| 11 | + <?php endif; ?> |
|
| 12 | 12 | <input type="hidden" value="<?php p($_['requesttoken']); ?>" name="requesttoken" /> |
| 13 | - <?php if($_['uploadChangable']): ?> |
|
| 13 | + <?php if ($_['uploadChangable']): ?> |
|
| 14 | 14 | <input type="submit" id="submitMaxUpload" |
| 15 | - value="<?php p($l->t( 'Save' )); ?>"/> |
|
| 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 | 17 | <?php else: ?> |
| 18 | 18 | <p><em><?php p($l->t('Missing permissions to edit from here.')); ?></em></p> |
@@ -19,14 +19,14 @@ |
||
| 19 | 19 | <tr> |
| 20 | 20 | <th id='headerName' class="hidden column-name"> |
| 21 | 21 | <div id="headerName-container"> |
| 22 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
| 22 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
| 23 | 23 | </div> |
| 24 | 24 | </th> |
| 25 | 25 | <th id="headerSize" class="hidden column-size"> |
| 26 | 26 | <a class="size sort columntitle" data-sort="size"><span><?php p($l->t('Size')); ?></span><span class="sort-indicator"></span></a> |
| 27 | 27 | </th> |
| 28 | 28 | <th id="headerDate" class="hidden column-mtime"> |
| 29 | - <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Modified' )); ?></span><span class="sort-indicator"></span></a> |
|
| 29 | + <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Modified')); ?></span><span class="sort-indicator"></span></a> |
|
| 30 | 30 | <span class="selectedActions"><a href="" class="delete-selected"> |
| 31 | 31 | <?php p($l->t('Delete'))?> |
| 32 | 32 | <img class="svg" alt="<?php p($l->t('Delete'))?>" |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | <li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>"> |
| 5 | 5 | <a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>" |
| 6 | 6 | class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"> |
| 7 | - <?php p($item['name']);?> |
|
| 7 | + <?php p($item['name']); ?> |
|
| 8 | 8 | </a> |
| 9 | 9 | </li> |
| 10 | 10 | <?php } ?> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | <div id="app-settings"> |
| 13 | 13 | <div id="app-settings-header"> |
| 14 | 14 | <button class="settings-button" data-apps-slide-toggle="#app-settings-content"> |
| 15 | - <?php p($l->t('Settings'));?> |
|
| 15 | + <?php p($l->t('Settings')); ?> |
|
| 16 | 16 | </button> |
| 17 | 17 | </div> |
| 18 | 18 | <div id="app-settings-content"> |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | <input class="checkbox" id="showhiddenfilesToggle" checked="checked" type="checkbox"> |
| 21 | 21 | <label for="showhiddenfilesToggle"><?php p($l->t('Show hidden files')); ?></label> |
| 22 | 22 | </div> |
| 23 | - <label for="webdavurl"><?php p($l->t('WebDAV'));?></label> |
|
| 23 | + <label for="webdavurl"><?php p($l->t('WebDAV')); ?></label> |
|
| 24 | 24 | <input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" /> |
| 25 | - <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em> |
|
| 25 | + <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em> |
|
| 26 | 26 | </div> |
| 27 | 27 | </div> |
| 28 | 28 | </div> |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $dir = '/'; |
| 27 | 27 | |
| 28 | 28 | if (isset($_GET['dir'])) { |
| 29 | - $dir = (string)$_GET['dir']; |
|
| 29 | + $dir = (string) $_GET['dir']; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | OCP\JSON::checkLoggedIn(); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $l = \OC::$server->getL10N('files'); |
| 29 | 29 | |
| 30 | 30 | // Load the files |
| 31 | -$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; |
|
| 31 | +$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : ''; |
|
| 32 | 32 | $dir = \OC\Files\Filesystem::normalizePath($dir); |
| 33 | 33 | |
| 34 | 34 | try { |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $data = array(); |
| 42 | - $baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir='; |
|
| 42 | + $baseUrl = OCP\Util::linkTo('files', 'index.php').'?dir='; |
|
| 43 | 43 | |
| 44 | 44 | $permissions = $dirInfo->getPermissions(); |
| 45 | 45 | |
| 46 | - $sortAttribute = isset($_GET['sort']) ? (string)$_GET['sort'] : 'name'; |
|
| 46 | + $sortAttribute = isset($_GET['sort']) ? (string) $_GET['sort'] : 'name'; |
|
| 47 | 47 | $sortDirection = isset($_GET['sortdirection']) ? ($_GET['sortdirection'] === 'desc') : false; |
| 48 | 48 | $mimetypeFilters = isset($_GET['mimetypes']) ? json_decode($_GET['mimetypes']) : ''; |
| 49 | 49 | |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | OCP\User::checkLoggedIn(); |
| 32 | 32 | \OC::$server->getSession()->close(); |
| 33 | 33 | |
| 34 | -$files = isset($_GET['files']) ? (string)$_GET['files'] : ''; |
|
| 35 | -$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; |
|
| 34 | +$files = isset($_GET['files']) ? (string) $_GET['files'] : ''; |
|
| 35 | +$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : ''; |
|
| 36 | 36 | |
| 37 | 37 | $files_list = json_decode($files); |
| 38 | 38 | // in case we get only a single file |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | * the content must not be longer than 32 characters and must only contain |
| 46 | 46 | * alphanumeric characters |
| 47 | 47 | */ |
| 48 | -if(isset($_GET['downloadStartSecret']) |
|
| 48 | +if (isset($_GET['downloadStartSecret']) |
|
| 49 | 49 | && !isset($_GET['downloadStartSecret'][32]) |
| 50 | 50 | && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) { |
| 51 | 51 | setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() == 'HEAD' ); |
|
| 54 | +$server_params = array('head' => \OC::$server->getRequest()->getMethod() == 'HEAD'); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Http range requests support |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | use OCA\Files\Controller\ViewController; |
| 32 | 32 | |
| 33 | 33 | class Application extends App { |
| 34 | - public function __construct(array $urlParams=array()) { |
|
| 34 | + public function __construct(array $urlParams = array()) { |
|
| 35 | 35 | parent::__construct('files', $urlParams); |
| 36 | 36 | $container = $this->getContainer(); |
| 37 | 37 | $server = $container->getServer(); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * Controllers |
| 41 | 41 | */ |
| 42 | - $container->registerService('APIController', function (IContainer $c) use ($server) { |
|
| 42 | + $container->registerService('APIController', function(IContainer $c) use ($server) { |
|
| 43 | 43 | return new ApiController( |
| 44 | 44 | $c->query('AppName'), |
| 45 | 45 | $c->query('Request'), |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ); |
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | - $container->registerService('ViewController', function (IContainer $c) use ($server) { |
|
| 55 | + $container->registerService('ViewController', function(IContainer $c) use ($server) { |
|
| 56 | 56 | return new ViewController( |
| 57 | 57 | $c->query('AppName'), |
| 58 | 58 | $c->query('Request'), |
@@ -76,10 +76,10 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * Services |
| 78 | 78 | */ |
| 79 | - $container->registerService('Tagger', function(IContainer $c) { |
|
| 79 | + $container->registerService('Tagger', function(IContainer $c) { |
|
| 80 | 80 | return $c->query('ServerContainer')->getTagManager()->load('files'); |
| 81 | 81 | }); |
| 82 | - $container->registerService('TagService', function(IContainer $c) { |
|
| 82 | + $container->registerService('TagService', function(IContainer $c) { |
|
| 83 | 83 | $homeFolder = $c->query('ServerContainer')->getUserFolder(); |
| 84 | 84 | return new TagService( |
| 85 | 85 | $c->query('ServerContainer')->getUserSession(), |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'uploadMaxFilesize' => $maxUploadFileSize, |
| 55 | 55 | 'maxHumanFilesize' => $maxHumanFileSize, |
| 56 | 56 | 'freeSpace' => $storageInfo['free'], |
| 57 | - 'usedSpacePercent' => (int)$storageInfo['relative'], |
|
| 57 | + 'usedSpacePercent' => (int) $storageInfo['relative'], |
|
| 58 | 58 | 'owner' => $storageInfo['owner'], |
| 59 | 59 | 'ownerDisplayName' => $storageInfo['ownerDisplayName'], |
| 60 | 60 | ]; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @return string icon URL |
| 68 | 68 | */ |
| 69 | 69 | public static function determineIcon($file) { |
| 70 | - if($file['type'] === 'dir') { |
|
| 70 | + if ($file['type'] === 'dir') { |
|
| 71 | 71 | $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir'); |
| 72 | 72 | // TODO: move this part to the client side, using mountType |
| 73 | 73 | if ($file->isShared()) { |
@@ -75,11 +75,11 @@ discard block |
||
| 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 | |
| 82 | - return substr($icon, 0, -3) . 'svg'; |
|
| 82 | + return substr($icon, 0, -3).'svg'; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $path = basename($fullPath); |
| 104 | 104 | |
| 105 | 105 | if ($normalizedPath !== $path) { |
| 106 | - $output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>'); |
|
| 106 | + $output->writeln("\t<error>Entry \"".$fullPath.'" will not be accessible due to incompatible encoding</error>'); |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
@@ -113,32 +113,32 @@ discard block |
||
| 113 | 113 | # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception |
| 114 | 114 | # printout and count |
| 115 | 115 | if ($verbose) { |
| 116 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 116 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 117 | 117 | $output->writeln("\tFile <info>$path</info>"); |
| 118 | 118 | $this->filesCounter += 1; |
| 119 | 119 | if ($this->hasBeenInterrupted()) { |
| 120 | 120 | throw new \Exception('ctrl-c'); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 123 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 124 | 124 | $output->writeln("\tFolder <info>$path</info>"); |
| 125 | 125 | $this->foldersCounter += 1; |
| 126 | 126 | if ($this->hasBeenInterrupted()) { |
| 127 | 127 | throw new \Exception('ctrl-c'); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { |
|
| 131 | - $output->writeln("Error while scanning, storage not available (" . $e->getMessage() . ")"); |
|
| 130 | + $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function(StorageNotAvailableException $e) use ($output) { |
|
| 131 | + $output->writeln("Error while scanning, storage not available (".$e->getMessage().")"); |
|
| 132 | 132 | }); |
| 133 | 133 | # count only |
| 134 | 134 | } else { |
| 135 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function () use ($output) { |
|
| 135 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function() use ($output) { |
|
| 136 | 136 | $this->filesCounter += 1; |
| 137 | 137 | if ($this->hasBeenInterrupted()) { |
| 138 | 138 | throw new \Exception('ctrl-c'); |
| 139 | 139 | } |
| 140 | 140 | }); |
| 141 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function () use ($output) { |
|
| 141 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function() use ($output) { |
|
| 142 | 142 | $this->foldersCounter += 1; |
| 143 | 143 | if ($this->hasBeenInterrupted()) { |
| 144 | 144 | throw new \Exception('ctrl-c'); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | try { |
| 156 | 156 | if ($backgroundScan) { |
| 157 | 157 | $scanner->backgroundScan($path); |
| 158 | - }else { |
|
| 158 | + } else { |
|
| 159 | 159 | $scanner->scan($path); |
| 160 | 160 | } |
| 161 | 161 | } catch (ForbiddenException $e) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $output->writeln("Make sure you're running the scan command only as the user the web server runs as"); |
| 164 | 164 | } catch (\Exception $e) { |
| 165 | 165 | if ($e->getMessage() !== 'ctrl-c') { |
| 166 | - $output->writeln('<error>Exception while scanning: ' . $e->getMessage() . "\n" . $e->getTraceAsString() . '</error>'); |
|
| 166 | + $output->writeln('<error>Exception while scanning: '.$e->getMessage()."\n".$e->getTraceAsString().'</error>'); |
|
| 167 | 167 | } |
| 168 | 168 | return; |
| 169 | 169 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 174 | 174 | $inputPath = $input->getOption('path'); |
| 175 | 175 | if ($inputPath) { |
| 176 | - $inputPath = '/' . trim($inputPath, '/'); |
|
| 176 | + $inputPath = '/'.trim($inputPath, '/'); |
|
| 177 | 177 | list (, $user,) = explode('/', $inputPath, 3); |
| 178 | 178 | $users = array($user); |
| 179 | 179 | } else if ($input->getOption('all')) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $verbose = $input->getOption('verbose'); |
| 193 | 193 | $quiet = $input->getOption('quiet'); |
| 194 | 194 | # restrict the verbosity level to VERBOSITY_VERBOSE |
| 195 | - if ($output->getVerbosity()>OutputInterface::VERBOSITY_VERBOSE) { |
|
| 195 | + if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) { |
|
| 196 | 196 | $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); |
| 197 | 197 | } |
| 198 | 198 | if ($quiet) { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | if (is_object($user)) { |
| 218 | 218 | $user = $user->getUID(); |
| 219 | 219 | } |
| 220 | - $path = $inputPath ? $inputPath : '/' . $user; |
|
| 220 | + $path = $inputPath ? $inputPath : '/'.$user; |
|
| 221 | 221 | $user_count += 1; |
| 222 | 222 | if ($this->userManager->userExists($user)) { |
| 223 | 223 | # add an extra line when verbose is set to optical separate users |