@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $result = array(); |
45 | 45 | $timestamp = null; |
46 | 46 | |
47 | - $view = new \OC\Files\View('/' . $user . '/files_trashbin/files'); |
|
47 | + $view = new \OC\Files\View('/'.$user.'/files_trashbin/files'); |
|
48 | 48 | |
49 | 49 | if (ltrim($dir, '/') !== '' && !$view->is_dir($dir)) { |
50 | 50 | throw new \Exception('Directory does not exists'); |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE |
91 | 91 | ); |
92 | 92 | if ($originalPath) { |
93 | - $i['extraData'] = $originalPath . '/' . $id; |
|
93 | + $i['extraData'] = $originalPath.'/'.$id; |
|
94 | 94 | } |
95 | - $result[] = new FileInfo($absoluteDir . '/' . $i['name'], $storage, $internalPath . '/' . $i['name'], $i, $mount); |
|
95 | + $result[] = new FileInfo($absoluteDir.'/'.$i['name'], $storage, $internalPath.'/'.$i['name'], $i, $mount); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | if ($sortAttribute !== '') { |
@@ -117,7 +117,7 @@ |
||
117 | 117 | \OC_Util::setupFS($user); |
118 | 118 | |
119 | 119 | // Check if this user has a trashbin directory |
120 | - $view = new \OC\Files\View('/' . $user); |
|
120 | + $view = new \OC\Files\View('/'.$user); |
|
121 | 121 | if (!$view->is_dir('/files_trashbin/files')) { |
122 | 122 | return false; |
123 | 123 | } |
@@ -107,8 +107,8 @@ |
||
107 | 107 | protected function removeDeletedFiles($uid) { |
108 | 108 | \OC_Util::tearDownFS(); |
109 | 109 | \OC_Util::setupFS($uid); |
110 | - if ($this->rootFolder->nodeExists('/' . $uid . '/files_trashbin')) { |
|
111 | - $this->rootFolder->get('/' . $uid . '/files_trashbin')->delete(); |
|
110 | + if ($this->rootFolder->nodeExists('/'.$uid.'/files_trashbin')) { |
|
111 | + $this->rootFolder->get('/'.$uid.'/files_trashbin')->delete(); |
|
112 | 112 | $query = $this->dbConnection->getQueryBuilder(); |
113 | 113 | $query->delete('files_trash') |
114 | 114 | ->where($query->expr()->eq('user', $query->createParameter('uid'))) |
@@ -39,7 +39,7 @@ |
||
39 | 39 | * to remove the used space for the trash bin stored in the database |
40 | 40 | */ |
41 | 41 | public static function deleteUser_hook($params) { |
42 | - if( \OCP\App::isEnabled('files_trashbin') ) { |
|
42 | + if (\OCP\App::isEnabled('files_trashbin')) { |
|
43 | 43 | $uid = $params['uid']; |
44 | 44 | Trashbin::deleteUser($uid); |
45 | 45 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** @var bool */ |
48 | 48 | private $canPurgeToSaveSpace; |
49 | 49 | |
50 | - public function __construct(IConfig $config,ITimeFactory $timeFactory){ |
|
50 | + public function __construct(IConfig $config, ITimeFactory $timeFactory) { |
|
51 | 51 | $this->timeFactory = $timeFactory; |
52 | 52 | $this->retentionObligation = $config->getSystemValue('trashbin_retention_obligation', 'auto'); |
53 | 53 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * Is trashbin expiration enabled |
61 | 61 | * @return bool |
62 | 62 | */ |
63 | - public function isEnabled(){ |
|
63 | + public function isEnabled() { |
|
64 | 64 | return $this->retentionObligation !== 'disabled'; |
65 | 65 | } |
66 | 66 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param bool $quotaExceeded |
71 | 71 | * @return bool |
72 | 72 | */ |
73 | - public function isExpired($timestamp, $quotaExceeded = false){ |
|
73 | + public function isExpired($timestamp, $quotaExceeded = false) { |
|
74 | 74 | // No expiration if disabled |
75 | 75 | if (!$this->isEnabled()) { |
76 | 76 | return false; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $time = $this->timeFactory->getTime(); |
85 | 85 | // Never expire dates in future e.g. misconfiguration or negative time |
86 | 86 | // adjustment |
87 | - if ($time<$timestamp) { |
|
87 | + if ($time < $timestamp) { |
|
88 | 88 | return false; |
89 | 89 | } |
90 | 90 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | return $maxAge; |
120 | 120 | } |
121 | 121 | |
122 | - private function parseRetentionObligation(){ |
|
122 | + private function parseRetentionObligation() { |
|
123 | 123 | $splitValues = explode(',', $this->retentionObligation); |
124 | 124 | if (!isset($splitValues[0])) { |
125 | 125 | $minValue = self::DEFAULT_RETENTION_OBLIGATION; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $newObligation = 'auto'; |
32 | 32 | if ($isExpirationEnabled) { |
33 | 33 | if (!is_null($oldObligation)) { |
34 | - $newObligation = strval($oldObligation) . ', auto'; |
|
34 | + $newObligation = strval($oldObligation).', auto'; |
|
35 | 35 | } |
36 | 36 | } else { |
37 | 37 | $newObligation = 'disabled'; |
@@ -32,5 +32,5 @@ |
||
32 | 32 | ?> |
33 | 33 | |
34 | 34 | -- |
35 | -<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?> |
|
35 | +<?php p($theme->getName().' - '.$theme->getSlogan()); ?> |
|
36 | 36 | <?php print_unescaped("\n".$theme->getBaseUrl()); |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | $share->getShareOwner(), |
227 | 227 | $share->getSharedBy(), $share->getSharedWith()); |
228 | 228 | } catch (HintException $hintException) { |
229 | - $this->logger->error('Failed to send share by mail: ' . $hintException->getMessage()); |
|
229 | + $this->logger->error('Failed to send share by mail: '.$hintException->getMessage()); |
|
230 | 230 | $this->removeShareFromTable($shareId); |
231 | 231 | throw $hintException; |
232 | 232 | } catch (\Exception $e) { |
233 | - $this->logger->error('Failed to send share by mail: ' . $e->getMessage()); |
|
233 | + $this->logger->error('Failed to send share by mail: '.$e->getMessage()); |
|
234 | 234 | $this->removeShareFromTable($shareId); |
235 | 235 | throw new HintException('Failed to send share by mail', |
236 | 236 | $this->l->t('Failed to send share by E-mail')); |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | $ownerDisplayName = ($ownerUser instanceof IUser) ? $ownerUser->getDisplayName() : $owner; |
247 | 247 | $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; |
248 | 248 | if ($owner === $initiator) { |
249 | - $subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); |
|
249 | + $subject = (string) $this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); |
|
250 | 250 | } else { |
251 | - $subject = (string)$this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName)); |
|
251 | + $subject = (string) $this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName)); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | $message = $this->mailer->createMessage(); |
@@ -275,11 +275,11 @@ discard block |
||
275 | 275 | protected function createMailBody($template, $filename, $link, $owner, $initiator) { |
276 | 276 | |
277 | 277 | $mailBodyTemplate = new Template('sharebymail', $template, ''); |
278 | - $mailBodyTemplate->assign ('filename', $filename); |
|
279 | - $mailBodyTemplate->assign ('link', $link); |
|
280 | - $mailBodyTemplate->assign ('owner', $owner); |
|
281 | - $mailBodyTemplate->assign ('initiator', $initiator); |
|
282 | - $mailBodyTemplate->assign ('onBehalfOf', $initiator !== $owner); |
|
278 | + $mailBodyTemplate->assign('filename', $filename); |
|
279 | + $mailBodyTemplate->assign('link', $link); |
|
280 | + $mailBodyTemplate->assign('owner', $owner); |
|
281 | + $mailBodyTemplate->assign('initiator', $initiator); |
|
282 | + $mailBodyTemplate->assign('onBehalfOf', $initiator !== $owner); |
|
283 | 283 | $mailBody = $mailBodyTemplate->fetchPage(); |
284 | 284 | |
285 | 285 | if (is_string($mailBody)) { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | protected function generateToken() { |
299 | 299 | $token = $this->secureRandom->generate( |
300 | - 15, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
300 | + 15, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
301 | 301 | return $token; |
302 | 302 | } |
303 | 303 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ->orderBy('id'); |
319 | 319 | |
320 | 320 | $cursor = $qb->execute(); |
321 | - while($data = $cursor->fetch()) { |
|
321 | + while ($data = $cursor->fetch()) { |
|
322 | 322 | $children[] = $this->createShareObject($data); |
323 | 323 | } |
324 | 324 | $cursor->closeCursor(); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $qb->execute(); |
362 | 362 | $id = $qb->getLastInsertId(); |
363 | 363 | |
364 | - return (int)$id; |
|
364 | + return (int) $id; |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | |
461 | 461 | $cursor = $qb->execute(); |
462 | 462 | $shares = []; |
463 | - while($data = $cursor->fetch()) { |
|
463 | + while ($data = $cursor->fetch()) { |
|
464 | 464 | $shares[] = $this->createShareObject($data); |
465 | 465 | } |
466 | 466 | $cursor->closeCursor(); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | ->execute(); |
513 | 513 | |
514 | 514 | $shares = []; |
515 | - while($data = $cursor->fetch()) { |
|
515 | + while ($data = $cursor->fetch()) { |
|
516 | 516 | $shares[] = $this->createShareObject($data); |
517 | 517 | } |
518 | 518 | $cursor->closeCursor(); |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | |
552 | 552 | $cursor = $qb->execute(); |
553 | 553 | |
554 | - while($data = $cursor->fetch()) { |
|
554 | + while ($data = $cursor->fetch()) { |
|
555 | 555 | $shares[] = $this->createShareObject($data); |
556 | 556 | } |
557 | 557 | $cursor->closeCursor(); |
@@ -614,15 +614,15 @@ discard block |
||
614 | 614 | protected function createShareObject($data) { |
615 | 615 | |
616 | 616 | $share = new Share($this->rootFolder, $this->userManager); |
617 | - $share->setId((int)$data['id']) |
|
618 | - ->setShareType((int)$data['share_type']) |
|
619 | - ->setPermissions((int)$data['permissions']) |
|
617 | + $share->setId((int) $data['id']) |
|
618 | + ->setShareType((int) $data['share_type']) |
|
619 | + ->setPermissions((int) $data['permissions']) |
|
620 | 620 | ->setTarget($data['file_target']) |
621 | - ->setMailSend((bool)$data['mail_send']) |
|
621 | + ->setMailSend((bool) $data['mail_send']) |
|
622 | 622 | ->setToken($data['token']); |
623 | 623 | |
624 | 624 | $shareTime = new \DateTime(); |
625 | - $shareTime->setTimestamp((int)$data['stime']); |
|
625 | + $shareTime->setTimestamp((int) $data['stime']); |
|
626 | 626 | $share->setShareTime($shareTime); |
627 | 627 | $share->setSharedWith($data['share_with']); |
628 | 628 | |
@@ -632,13 +632,13 @@ discard block |
||
632 | 632 | } else { |
633 | 633 | //OLD SHARE |
634 | 634 | $share->setSharedBy($data['uid_owner']); |
635 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
635 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
636 | 636 | |
637 | 637 | $owner = $path->getOwner(); |
638 | 638 | $share->setShareOwner($owner->getUID()); |
639 | 639 | } |
640 | 640 | |
641 | - $share->setNodeId((int)$data['file_source']); |
|
641 | + $share->setNodeId((int) $data['file_source']); |
|
642 | 642 | $share->setNodeType($data['item_type']); |
643 | 643 | |
644 | 644 | $share->setProviderId($this->identifier()); |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | ); |
758 | 758 | } |
759 | 759 | |
760 | - $qb->innerJoin('s', 'filecache' ,'f', 's.file_source = f.fileid'); |
|
760 | + $qb->innerJoin('s', 'filecache', 'f', 's.file_source = f.fileid'); |
|
761 | 761 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
762 | 762 | |
763 | 763 | $qb->orderBy('id'); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | <?php if (!empty($_['docs'])): ?> |
29 | 29 | <a target="_blank" rel="noreferrer" class="icon-info svg" |
30 | - title="<?php p($l->t('Open documentation'));?>" |
|
30 | + title="<?php p($l->t('Open documentation')); ?>" |
|
31 | 31 | href="<?php p(link_to_docs($_['docs'])); ?>"> |
32 | 32 | </a> |
33 | 33 | <?php endif; ?> |