@@ -71,34 +71,34 @@ |
||
71 | 71 | * @throws \InvalidArgumentException When the notification was not prepared by a notifier |
72 | 72 | */ |
73 | 73 | public function prepare(INotification $notification, $languageCode) { |
74 | - if($notification->getApp() !== 'comments') { |
|
74 | + if ($notification->getApp() !== 'comments') { |
|
75 | 75 | throw new \InvalidArgumentException(); |
76 | 76 | } |
77 | 77 | try { |
78 | 78 | $comment = $this->commentsManager->get($notification->getObjectId()); |
79 | - } catch(NotFoundException $e) { |
|
79 | + } catch (NotFoundException $e) { |
|
80 | 80 | // needs to be converted to InvalidArgumentException, otherwise none Notifications will be shown at all |
81 | 81 | throw new \InvalidArgumentException('Comment not found', 0, $e); |
82 | 82 | } |
83 | 83 | $l = $this->l10nFactory->get('comments', $languageCode); |
84 | 84 | $displayName = $comment->getActorId(); |
85 | 85 | $isDeletedActor = $comment->getActorType() === ICommentsManager::DELETED_USER; |
86 | - if($comment->getActorType() === 'users') { |
|
86 | + if ($comment->getActorType() === 'users') { |
|
87 | 87 | $commenter = $this->userManager->get($comment->getActorId()); |
88 | - if(!is_null($commenter)) { |
|
88 | + if (!is_null($commenter)) { |
|
89 | 89 | $displayName = $commenter->getDisplayName(); |
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
93 | - switch($notification->getSubject()) { |
|
93 | + switch ($notification->getSubject()) { |
|
94 | 94 | case 'mention': |
95 | 95 | $parameters = $notification->getSubjectParameters(); |
96 | - if($parameters[0] !== 'files') { |
|
96 | + if ($parameters[0] !== 'files') { |
|
97 | 97 | throw new \InvalidArgumentException('Unsupported comment object'); |
98 | 98 | } |
99 | 99 | $userFolder = $this->rootFolder->getUserFolder($notification->getUser()); |
100 | - $nodes = $userFolder->getById((int)$parameters[1]); |
|
101 | - if(empty($nodes)) { |
|
100 | + $nodes = $userFolder->getById((int) $parameters[1]); |
|
101 | + if (empty($nodes)) { |
|
102 | 102 | throw new \InvalidArgumentException('Cannot resolve file ID to node instance'); |
103 | 103 | } |
104 | 104 | $node = $nodes[0]; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
38 | -$appId = (string)$_POST['appid']; |
|
38 | +$appId = (string) $_POST['appid']; |
|
39 | 39 | $appId = OC_App::cleanAppId($appId); |
40 | 40 | |
41 | 41 | $config = \OC::$server->getConfig(); |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | $installer = \OC::$server->query(\OC\Installer::class); |
45 | 45 | $result = $installer->updateAppstoreApp($appId); |
46 | 46 | $config->setSystemValue('maintenance', false); |
47 | -} catch(Exception $ex) { |
|
47 | +} catch (Exception $ex) { |
|
48 | 48 | $config->setSystemValue('maintenance', false); |
49 | - OC_JSON::error(array('data' => array( 'message' => $ex->getMessage() ))); |
|
49 | + OC_JSON::error(array('data' => array('message' => $ex->getMessage()))); |
|
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | -if($result !== false) { |
|
53 | +if ($result !== false) { |
|
54 | 54 | OC_JSON::success(array('data' => array('appid' => $appId))); |
55 | 55 | } else { |
56 | 56 | $l = \OC::$server->getL10N('settings'); |
57 | - OC_JSON::error(array('data' => array( 'message' => $l->t("Couldn't update app.") ))); |
|
57 | + OC_JSON::error(array('data' => array('message' => $l->t("Couldn't update app.")))); |
|
58 | 58 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | unset($results['exact']); |
74 | 74 | $results = array_merge_recursive($exactMatches, $results); |
75 | 75 | |
76 | - if($sorter !== null) { |
|
76 | + if ($sorter !== null) { |
|
77 | 77 | $sorters = array_reverse(explode('|', $sorter)); |
78 | 78 | $this->autoCompleteManager->runSorters($sorters, $results, [ |
79 | 79 | 'itemType' => $itemType, |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $res['group'] = []; |
88 | 88 | $res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes'; |
89 | 89 | $res['group']['expire_date']['enabled'] = true; |
90 | - $res['default_permissions'] = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL); |
|
90 | + $res['default_permissions'] = (int) $this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | //Federated sharing |
@@ -27,94 +27,94 @@ |
||
27 | 27 | ?> |
28 | 28 | |
29 | 29 | <div class="section" id="shareAPI"> |
30 | - <h2><?php p($l->t('Sharing'));?></h2> |
|
30 | + <h2><?php p($l->t('Sharing')); ?></h2> |
|
31 | 31 | <a target="_blank" rel="noreferrer noopener" class="icon-info" |
32 | - title="<?php p($l->t('Open documentation'));?>" |
|
32 | + title="<?php p($l->t('Open documentation')); ?>" |
|
33 | 33 | href="<?php p(link_to_docs('admin-sharing')); ?>"></a> |
34 | - <p class="settings-hint"><?php p($l->t('As admin you can fine-tune the sharing behavior. Please see the documentation for more information.'));?></p> |
|
34 | + <p class="settings-hint"><?php p($l->t('As admin you can fine-tune the sharing behavior. Please see the documentation for more information.')); ?></p> |
|
35 | 35 | <p id="enable"> |
36 | 36 | <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox" |
37 | 37 | value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
38 | - <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> |
|
38 | + <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API')); ?></label><br/> |
|
39 | 39 | </p> |
40 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
40 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
41 | 41 | <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox" |
42 | 42 | value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
43 | - <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> |
|
43 | + <label for="allowLinks"><?php p($l->t('Allow users to share via link')); ?></label><br/> |
|
44 | 44 | </p> |
45 | 45 | |
46 | 46 | <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
47 | 47 | <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox" |
48 | 48 | value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> /> |
49 | - <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/> |
|
49 | + <label for="allowPublicUpload"><?php p($l->t('Allow public uploads')); ?></label><br/> |
|
50 | 50 | <input type="checkbox" name="shareapi_enable_link_password_by_default" id="enableLinkPasswordByDefault" class="checkbox" |
51 | 51 | value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
52 | - <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password'));?></label><br/> |
|
52 | + <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password')); ?></label><br/> |
|
53 | 53 | <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox" |
54 | 54 | value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> /> |
55 | - <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/> |
|
55 | + <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection')); ?></label><br/> |
|
56 | 56 | |
57 | 57 | <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox" |
58 | 58 | value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
59 | - <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/> |
|
59 | + <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date')); ?></label><br/> |
|
60 | 60 | |
61 | 61 | </p> |
62 | - <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
63 | - <?php p($l->t( 'Expire after ' )); ?> |
|
62 | + <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
63 | + <?php p($l->t('Expire after ')); ?> |
|
64 | 64 | <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>" |
65 | 65 | value='<?php p($_['shareExpireAfterNDays']) ?>' /> |
66 | - <?php p($l->t( 'days' )); ?> |
|
66 | + <?php p($l->t('days')); ?> |
|
67 | 67 | <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox" |
68 | 68 | value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
69 | - <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> |
|
69 | + <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date')); ?></label><br/> |
|
70 | 70 | </p> |
71 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
71 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
72 | 72 | <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox" |
73 | 73 | value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
74 | - <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> |
|
74 | + <label for="allowResharing"><?php p($l->t('Allow resharing')); ?></label><br/> |
|
75 | 75 | </p> |
76 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
76 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
77 | 77 | <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox" |
78 | 78 | value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
79 | - <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br /> |
|
79 | + <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups')); ?></label><br /> |
|
80 | 80 | </p> |
81 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
81 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
82 | 82 | <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox" |
83 | 83 | value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> |
84 | - <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> |
|
84 | + <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups')); ?></label><br/> |
|
85 | 85 | </p> |
86 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
86 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
87 | 87 | <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox" |
88 | 88 | value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> |
89 | - <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> |
|
89 | + <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing')); ?></label><br/> |
|
90 | 90 | </p> |
91 | 91 | <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
92 | 92 | <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px" class="noJSAutoUpdate"/> |
93 | 93 | <br /> |
94 | 94 | <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em> |
95 | 95 | </p> |
96 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
96 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
97 | 97 | <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox" |
98 | 98 | <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
99 | - <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username or email address needs to be entered.'));?></label><br /> |
|
99 | + <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username or email address needs to be entered.')); ?></label><br /> |
|
100 | 100 | </p> |
101 | 101 | <p> |
102 | 102 | <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate" |
103 | 103 | <?php if ($_['publicShareDisclaimerText'] !== null) print_unescaped('checked="checked"'); ?> /> |
104 | - <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label> |
|
104 | + <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)')); ?></label> |
|
105 | 105 | <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span> |
106 | 106 | <br/> |
107 | 107 | <textarea placeholder="<?php p($l->t('This text will be shown on the public link upload page when the file list is hidden.')) ?>" id="publicShareDisclaimerText" <?php if ($_['publicShareDisclaimerText'] === null) { print_unescaped('class="hidden"'); } ?>><?php p($_['publicShareDisclaimerText']) ?></textarea> |
108 | 108 | </p> |
109 | 109 | |
110 | - <h3><?php p($l->t('Default share permissions'));?></h3> |
|
110 | + <h3><?php p($l->t('Default share permissions')); ?></h3> |
|
111 | 111 | <input type="hidden" name="shareapi_default_permissions" id="shareApiDefaultPermissions" class="checkbox" |
112 | 112 | value="<?php p($_['shareApiDefaultPermissions']) ?>" /> |
113 | 113 | <p id="shareApiDefaultPermissionsSection" class="indent <?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
114 | 114 | <?php foreach ($_['shareApiDefaultPermissionsCheckboxes'] as $perm): ?> |
115 | 115 | <input type="checkbox" name="shareapi_default_permission_<?php p($perm['id']) ?>" id="shareapi_default_permission_<?php p($perm['id']) ?>" |
116 | 116 | class="noautosave checkbox" value="<?php p($perm['value']) ?>" <?php if (($_['shareApiDefaultPermissions'] & $perm['value']) !== 0) print_unescaped('checked="checked"'); ?> /> |
117 | - <label for="shareapi_default_permission_<?php p($perm['id']) ?>"><?php p($perm['label']);?></label> |
|
117 | + <label for="shareapi_default_permission_<?php p($perm['id']) ?>"><?php p($perm['label']); ?></label> |
|
118 | 118 | <?php endforeach ?> |
119 | 119 | </p> |
120 | 120 | </div> |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if ($path === '') { |
59 | 59 | return $this->getRoot(); |
60 | 60 | } else { |
61 | - return $this->getRoot() . '/' . ltrim($path, '/'); |
|
61 | + return $this->getRoot().'/'.ltrim($path, '/'); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $rootLength = strlen($this->getRoot()) + 1; |
74 | 74 | if ($path === $this->getRoot()) { |
75 | 75 | return ''; |
76 | - } else if (substr($path, 0, $rootLength) === $this->getRoot() . '/') { |
|
76 | + } else if (substr($path, 0, $rootLength) === $this->getRoot().'/') { |
|
77 | 77 | return substr($path, $rootLength); |
78 | 78 | } else { |
79 | 79 | return null; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | protected function filterCacheEntry($entry) { |
95 | 95 | $rootLength = strlen($this->getRoot()) + 1; |
96 | - return ($entry['path'] === $this->getRoot()) or (substr($entry['path'], 0, $rootLength) === $this->getRoot() . '/'); |
|
96 | + return ($entry['path'] === $this->getRoot()) or (substr($entry['path'], 0, $rootLength) === $this->getRoot().'/'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->defaultColorPrimary = '#0082c9'; |
70 | 70 | $this->defaultTextColorPrimary = '#ffffff'; |
71 | 71 | |
72 | - $themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php'; |
|
72 | + $themePath = OC::$SERVERROOT.'/themes/'.OC_Util::getTheme().'/defaults.php'; |
|
73 | 73 | if (file_exists($themePath)) { |
74 | 74 | // prevent defaults.php from printing output |
75 | 75 | ob_start(); |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | if ($this->themeExist('getShortFooter')) { |
241 | 241 | $footer = $this->theme->getShortFooter(); |
242 | 242 | } else { |
243 | - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
244 | - ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. |
|
245 | - ' – ' . $this->getSlogan(); |
|
243 | + $footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'. |
|
244 | + ' rel="noreferrer noopener">'.$this->getEntity().'</a>'. |
|
245 | + ' – '.$this->getSlogan(); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | return $footer; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | if ($this->themeExist('buildDocLinkToKey')) { |
271 | 271 | return $this->theme->buildDocLinkToKey($key); |
272 | 272 | } |
273 | - return $this->getDocBaseUrl() . '/server/' . $this->defaultDocVersion . '/go.php?to=' . $key; |
|
273 | + return $this->getDocBaseUrl().'/server/'.$this->defaultDocVersion.'/go.php?to='.$key; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @return array scss variables to overwrite |
293 | 293 | */ |
294 | 294 | public function getScssVariables() { |
295 | - if($this->themeExist('getScssVariables')) { |
|
295 | + if ($this->themeExist('getScssVariables')) { |
|
296 | 296 | return $this->theme->getScssVariables(); |
297 | 297 | } |
298 | 298 | return []; |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | return $this->theme->getLogo($useSvg); |
314 | 314 | } |
315 | 315 | |
316 | - if($useSvg) { |
|
316 | + if ($useSvg) { |
|
317 | 317 | $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo.svg'); |
318 | 318 | } else { |
319 | 319 | $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo.png'); |
320 | 320 | } |
321 | - return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion())); |
|
321 | + return $logo.'?v='.hash('sha1', implode('.', \OCP\Util::getVersion())); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | public function getTextColorPrimary() { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $principals = []; |
99 | 99 | |
100 | 100 | if ($prefixPath === $this->principalPrefix) { |
101 | - foreach($this->userManager->search('') as $user) { |
|
101 | + foreach ($this->userManager->search('') as $user) { |
|
102 | 102 | $principals[] = $this->userToPrincipal($user); |
103 | 103 | } |
104 | 104 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $groups = $this->groupManager->getUserGroups($user); |
166 | 166 | $groups = array_map(function($group) { |
167 | 167 | /** @var IGroup $group */ |
168 | - return 'principals/groups/' . urlencode($group->getGID()); |
|
168 | + return 'principals/groups/'.urlencode($group->getGID()); |
|
169 | 169 | }, $groups); |
170 | 170 | |
171 | 171 | return $groups; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | - $carry[] = $this->principalPrefix . '/' . $user->getUID(); |
|
240 | + $carry[] = $this->principalPrefix.'/'.$user->getUID(); |
|
241 | 241 | return $carry; |
242 | 242 | }, []); |
243 | 243 | break; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | - return $this->principalPrefix . '/' . $user->getUID(); |
|
325 | + return $this->principalPrefix.'/'.$user->getUID(); |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $userId = $user->getUID(); |
338 | 338 | $displayName = $user->getDisplayName(); |
339 | 339 | $principal = [ |
340 | - 'uri' => $this->principalPrefix . '/' . $userId, |
|
340 | + 'uri' => $this->principalPrefix.'/'.$userId, |
|
341 | 341 | '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, |
342 | 342 | ]; |
343 | 343 |
@@ -96,44 +96,44 @@ discard block |
||
96 | 96 | |
97 | 97 | if ($event->getSubject() === self::SUBJECT_ADD) { |
98 | 98 | $subject = $this->l->t('{actor} created calendar {calendar}'); |
99 | - } else if ($event->getSubject() === self::SUBJECT_ADD . '_self') { |
|
99 | + } else if ($event->getSubject() === self::SUBJECT_ADD.'_self') { |
|
100 | 100 | $subject = $this->l->t('You created calendar {calendar}'); |
101 | 101 | } else if ($event->getSubject() === self::SUBJECT_DELETE) { |
102 | 102 | $subject = $this->l->t('{actor} deleted calendar {calendar}'); |
103 | - } else if ($event->getSubject() === self::SUBJECT_DELETE . '_self') { |
|
103 | + } else if ($event->getSubject() === self::SUBJECT_DELETE.'_self') { |
|
104 | 104 | $subject = $this->l->t('You deleted calendar {calendar}'); |
105 | 105 | } else if ($event->getSubject() === self::SUBJECT_UPDATE) { |
106 | 106 | $subject = $this->l->t('{actor} updated calendar {calendar}'); |
107 | - } else if ($event->getSubject() === self::SUBJECT_UPDATE . '_self') { |
|
107 | + } else if ($event->getSubject() === self::SUBJECT_UPDATE.'_self') { |
|
108 | 108 | $subject = $this->l->t('You updated calendar {calendar}'); |
109 | 109 | |
110 | - } else if ($event->getSubject() === self::SUBJECT_PUBLISH . '_self') { |
|
110 | + } else if ($event->getSubject() === self::SUBJECT_PUBLISH.'_self') { |
|
111 | 111 | $subject = $this->l->t('You shared calendar {calendar} as public link'); |
112 | - } else if ($event->getSubject() === self::SUBJECT_UNPUBLISH . '_self') { |
|
112 | + } else if ($event->getSubject() === self::SUBJECT_UNPUBLISH.'_self') { |
|
113 | 113 | $subject = $this->l->t('You removed public link for calendar {calendar}'); |
114 | 114 | |
115 | 115 | } else if ($event->getSubject() === self::SUBJECT_SHARE_USER) { |
116 | 116 | $subject = $this->l->t('{actor} shared calendar {calendar} with you'); |
117 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') { |
|
117 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_USER.'_you') { |
|
118 | 118 | $subject = $this->l->t('You shared calendar {calendar} with {user}'); |
119 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_by') { |
|
119 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_USER.'_by') { |
|
120 | 120 | $subject = $this->l->t('{actor} shared calendar {calendar} with {user}'); |
121 | 121 | } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER) { |
122 | 122 | $subject = $this->l->t('{actor} unshared calendar {calendar} from you'); |
123 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_you') { |
|
123 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_you') { |
|
124 | 124 | $subject = $this->l->t('You unshared calendar {calendar} from {user}'); |
125 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_by') { |
|
125 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_by') { |
|
126 | 126 | $subject = $this->l->t('{actor} unshared calendar {calendar} from {user}'); |
127 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') { |
|
127 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_self') { |
|
128 | 128 | $subject = $this->l->t('{actor} unshared calendar {calendar} from themselves'); |
129 | 129 | |
130 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') { |
|
130 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_you') { |
|
131 | 131 | $subject = $this->l->t('You shared calendar {calendar} with group {group}'); |
132 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') { |
|
132 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_by') { |
|
133 | 133 | $subject = $this->l->t('{actor} shared calendar {calendar} with group {group}'); |
134 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_you') { |
|
134 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_you') { |
|
135 | 135 | $subject = $this->l->t('You unshared calendar {calendar} from group {group}'); |
136 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_by') { |
|
136 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_by') { |
|
137 | 137 | $subject = $this->l->t('{actor} unshared calendar {calendar} from group {group}'); |
138 | 138 | } else { |
139 | 139 | throw new \InvalidArgumentException(); |
@@ -169,39 +169,39 @@ discard block |
||
169 | 169 | if (isset($parameters['calendar'])) { |
170 | 170 | switch ($subject) { |
171 | 171 | case self::SUBJECT_ADD: |
172 | - case self::SUBJECT_ADD . '_self': |
|
172 | + case self::SUBJECT_ADD.'_self': |
|
173 | 173 | case self::SUBJECT_DELETE: |
174 | - case self::SUBJECT_DELETE . '_self': |
|
174 | + case self::SUBJECT_DELETE.'_self': |
|
175 | 175 | case self::SUBJECT_UPDATE: |
176 | - case self::SUBJECT_UPDATE . '_self': |
|
176 | + case self::SUBJECT_UPDATE.'_self': |
|
177 | 177 | case self::SUBJECT_SHARE_USER: |
178 | 178 | case self::SUBJECT_UNSHARE_USER: |
179 | - case self::SUBJECT_UNSHARE_USER . '_self': |
|
179 | + case self::SUBJECT_UNSHARE_USER.'_self': |
|
180 | 180 | return [ |
181 | 181 | 'actor' => $this->generateUserParameter($parameters['actor']), |
182 | 182 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
183 | 183 | ]; |
184 | - case self::SUBJECT_SHARE_USER . '_you': |
|
185 | - case self::SUBJECT_UNSHARE_USER . '_you': |
|
184 | + case self::SUBJECT_SHARE_USER.'_you': |
|
185 | + case self::SUBJECT_UNSHARE_USER.'_you': |
|
186 | 186 | return [ |
187 | 187 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
188 | 188 | 'user' => $this->generateUserParameter($parameters['user']), |
189 | 189 | ]; |
190 | - case self::SUBJECT_SHARE_USER . '_by': |
|
191 | - case self::SUBJECT_UNSHARE_USER . '_by': |
|
190 | + case self::SUBJECT_SHARE_USER.'_by': |
|
191 | + case self::SUBJECT_UNSHARE_USER.'_by': |
|
192 | 192 | return [ |
193 | 193 | 'actor' => $this->generateUserParameter($parameters['actor']), |
194 | 194 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
195 | 195 | 'user' => $this->generateUserParameter($parameters['user']), |
196 | 196 | ]; |
197 | - case self::SUBJECT_SHARE_GROUP . '_you': |
|
198 | - case self::SUBJECT_UNSHARE_GROUP . '_you': |
|
197 | + case self::SUBJECT_SHARE_GROUP.'_you': |
|
198 | + case self::SUBJECT_UNSHARE_GROUP.'_you': |
|
199 | 199 | return [ |
200 | 200 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
201 | 201 | 'group' => $this->generateGroupParameter($parameters['group']), |
202 | 202 | ]; |
203 | - case self::SUBJECT_SHARE_GROUP . '_by': |
|
204 | - case self::SUBJECT_UNSHARE_GROUP . '_by': |
|
203 | + case self::SUBJECT_SHARE_GROUP.'_by': |
|
204 | + case self::SUBJECT_UNSHARE_GROUP.'_by': |
|
205 | 205 | return [ |
206 | 206 | 'actor' => $this->generateUserParameter($parameters['actor']), |
207 | 207 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
@@ -217,44 +217,44 @@ discard block |
||
217 | 217 | // they will get the dead entries in their stream. |
218 | 218 | switch ($subject) { |
219 | 219 | case self::SUBJECT_ADD: |
220 | - case self::SUBJECT_ADD . '_self': |
|
220 | + case self::SUBJECT_ADD.'_self': |
|
221 | 221 | case self::SUBJECT_DELETE: |
222 | - case self::SUBJECT_DELETE . '_self': |
|
222 | + case self::SUBJECT_DELETE.'_self': |
|
223 | 223 | case self::SUBJECT_UPDATE: |
224 | - case self::SUBJECT_UPDATE . '_self': |
|
225 | - case self::SUBJECT_PUBLISH . '_self': |
|
226 | - case self::SUBJECT_UNPUBLISH . '_self': |
|
224 | + case self::SUBJECT_UPDATE.'_self': |
|
225 | + case self::SUBJECT_PUBLISH.'_self': |
|
226 | + case self::SUBJECT_UNPUBLISH.'_self': |
|
227 | 227 | case self::SUBJECT_SHARE_USER: |
228 | 228 | case self::SUBJECT_UNSHARE_USER: |
229 | - case self::SUBJECT_UNSHARE_USER . '_self': |
|
229 | + case self::SUBJECT_UNSHARE_USER.'_self': |
|
230 | 230 | return [ |
231 | 231 | 'actor' => $this->generateUserParameter($parameters[0]), |
232 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
232 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
233 | 233 | ]; |
234 | - case self::SUBJECT_SHARE_USER . '_you': |
|
235 | - case self::SUBJECT_UNSHARE_USER . '_you': |
|
234 | + case self::SUBJECT_SHARE_USER.'_you': |
|
235 | + case self::SUBJECT_UNSHARE_USER.'_you': |
|
236 | 236 | return [ |
237 | 237 | 'user' => $this->generateUserParameter($parameters[0]), |
238 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
238 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
239 | 239 | ]; |
240 | - case self::SUBJECT_SHARE_USER . '_by': |
|
241 | - case self::SUBJECT_UNSHARE_USER . '_by': |
|
240 | + case self::SUBJECT_SHARE_USER.'_by': |
|
241 | + case self::SUBJECT_UNSHARE_USER.'_by': |
|
242 | 242 | return [ |
243 | 243 | 'user' => $this->generateUserParameter($parameters[0]), |
244 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
244 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
245 | 245 | 'actor' => $this->generateUserParameter($parameters[2]), |
246 | 246 | ]; |
247 | - case self::SUBJECT_SHARE_GROUP . '_you': |
|
248 | - case self::SUBJECT_UNSHARE_GROUP . '_you': |
|
247 | + case self::SUBJECT_SHARE_GROUP.'_you': |
|
248 | + case self::SUBJECT_UNSHARE_GROUP.'_you': |
|
249 | 249 | return [ |
250 | 250 | 'group' => $this->generateGroupParameter($parameters[0]), |
251 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
251 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
252 | 252 | ]; |
253 | - case self::SUBJECT_SHARE_GROUP . '_by': |
|
254 | - case self::SUBJECT_UNSHARE_GROUP . '_by': |
|
253 | + case self::SUBJECT_SHARE_GROUP.'_by': |
|
254 | + case self::SUBJECT_UNSHARE_GROUP.'_by': |
|
255 | 255 | return [ |
256 | 256 | 'group' => $this->generateGroupParameter($parameters[0]), |
257 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
257 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
258 | 258 | 'actor' => $this->generateUserParameter($parameters[2]), |
259 | 259 | ]; |
260 | 260 | } |