@@ -49,7 +49,7 @@ |
||
49 | 49 | protected function setSubjects(IEvent $event, $subject, array $parameters) { |
50 | 50 | $placeholders = $replacements = []; |
51 | 51 | foreach ($parameters as $placeholder => $parameter) { |
52 | - $placeholders[] = '{' . $placeholder . '}'; |
|
52 | + $placeholders[] = '{'.$placeholder.'}'; |
|
53 | 53 | $replacements[] = $parameter['name']; |
54 | 54 | } |
55 | 55 |
@@ -36,136 +36,136 @@ |
||
36 | 36 | |
37 | 37 | abstract class Base implements IProvider { |
38 | 38 | |
39 | - /** @var IUserManager */ |
|
40 | - protected $userManager; |
|
41 | - |
|
42 | - /** @var string[] */ |
|
43 | - protected $userDisplayNames = []; |
|
44 | - |
|
45 | - /** @var IGroupManager */ |
|
46 | - protected $groupManager; |
|
47 | - |
|
48 | - /** @var string[] */ |
|
49 | - protected $groupDisplayNames = []; |
|
50 | - |
|
51 | - /** @var IURLGenerator */ |
|
52 | - protected $url; |
|
53 | - |
|
54 | - /** |
|
55 | - * @param IUserManager $userManager |
|
56 | - * @param IGroupManager $groupManager |
|
57 | - * @param IURLGenerator $urlGenerator |
|
58 | - */ |
|
59 | - public function __construct(IUserManager $userManager, IGroupManager $groupManager, IURLGenerator $urlGenerator) { |
|
60 | - $this->userManager = $userManager; |
|
61 | - $this->groupManager = $groupManager; |
|
62 | - $this->url = $urlGenerator; |
|
63 | - } |
|
64 | - |
|
65 | - /** |
|
66 | - * @param IEvent $event |
|
67 | - * @param string $subject |
|
68 | - * @param array $parameters |
|
69 | - */ |
|
70 | - protected function setSubjects(IEvent $event, $subject, array $parameters) { |
|
71 | - $placeholders = $replacements = []; |
|
72 | - foreach ($parameters as $placeholder => $parameter) { |
|
73 | - $placeholders[] = '{' . $placeholder . '}'; |
|
74 | - $replacements[] = $parameter['name']; |
|
75 | - } |
|
76 | - |
|
77 | - $event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) |
|
78 | - ->setRichSubject($subject, $parameters); |
|
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * @param array $data |
|
83 | - * @param IL10N $l |
|
84 | - * @return array |
|
85 | - */ |
|
86 | - protected function generateCalendarParameter($data, IL10N $l) { |
|
87 | - if ($data['uri'] === CalDavBackend::PERSONAL_CALENDAR_URI && |
|
88 | - $data['name'] === CalDavBackend::PERSONAL_CALENDAR_NAME) { |
|
89 | - return [ |
|
90 | - 'type' => 'calendar', |
|
91 | - 'id' => $data['id'], |
|
92 | - 'name' => $l->t('Personal'), |
|
93 | - ]; |
|
94 | - } |
|
95 | - |
|
96 | - return [ |
|
97 | - 'type' => 'calendar', |
|
98 | - 'id' => $data['id'], |
|
99 | - 'name' => $data['name'], |
|
100 | - ]; |
|
101 | - } |
|
102 | - |
|
103 | - /** |
|
104 | - * @param int $id |
|
105 | - * @param string $name |
|
106 | - * @return array |
|
107 | - */ |
|
108 | - protected function generateLegacyCalendarParameter($id, $name) { |
|
109 | - return [ |
|
110 | - 'type' => 'calendar', |
|
111 | - 'id' => $id, |
|
112 | - 'name' => $name, |
|
113 | - ]; |
|
114 | - } |
|
115 | - |
|
116 | - /** |
|
117 | - * @param string $uid |
|
118 | - * @return array |
|
119 | - */ |
|
120 | - protected function generateUserParameter($uid) { |
|
121 | - if (!isset($this->userDisplayNames[$uid])) { |
|
122 | - $this->userDisplayNames[$uid] = $this->getUserDisplayName($uid); |
|
123 | - } |
|
124 | - |
|
125 | - return [ |
|
126 | - 'type' => 'user', |
|
127 | - 'id' => $uid, |
|
128 | - 'name' => $this->userDisplayNames[$uid], |
|
129 | - ]; |
|
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * @param string $uid |
|
134 | - * @return string |
|
135 | - */ |
|
136 | - protected function getUserDisplayName($uid) { |
|
137 | - $user = $this->userManager->get($uid); |
|
138 | - if ($user instanceof IUser) { |
|
139 | - return $user->getDisplayName(); |
|
140 | - } |
|
141 | - return $uid; |
|
142 | - } |
|
143 | - |
|
144 | - /** |
|
145 | - * @param string $gid |
|
146 | - * @return array |
|
147 | - */ |
|
148 | - protected function generateGroupParameter($gid) { |
|
149 | - if (!isset($this->groupDisplayNames[$gid])) { |
|
150 | - $this->groupDisplayNames[$gid] = $this->getGroupDisplayName($gid); |
|
151 | - } |
|
152 | - |
|
153 | - return [ |
|
154 | - 'type' => 'user-group', |
|
155 | - 'id' => $gid, |
|
156 | - 'name' => $this->groupDisplayNames[$gid], |
|
157 | - ]; |
|
158 | - } |
|
159 | - |
|
160 | - /** |
|
161 | - * @param string $gid |
|
162 | - * @return string |
|
163 | - */ |
|
164 | - protected function getGroupDisplayName($gid) { |
|
165 | - $group = $this->groupManager->get($gid); |
|
166 | - if ($group instanceof IGroup) { |
|
167 | - return $group->getDisplayName(); |
|
168 | - } |
|
169 | - return $gid; |
|
170 | - } |
|
39 | + /** @var IUserManager */ |
|
40 | + protected $userManager; |
|
41 | + |
|
42 | + /** @var string[] */ |
|
43 | + protected $userDisplayNames = []; |
|
44 | + |
|
45 | + /** @var IGroupManager */ |
|
46 | + protected $groupManager; |
|
47 | + |
|
48 | + /** @var string[] */ |
|
49 | + protected $groupDisplayNames = []; |
|
50 | + |
|
51 | + /** @var IURLGenerator */ |
|
52 | + protected $url; |
|
53 | + |
|
54 | + /** |
|
55 | + * @param IUserManager $userManager |
|
56 | + * @param IGroupManager $groupManager |
|
57 | + * @param IURLGenerator $urlGenerator |
|
58 | + */ |
|
59 | + public function __construct(IUserManager $userManager, IGroupManager $groupManager, IURLGenerator $urlGenerator) { |
|
60 | + $this->userManager = $userManager; |
|
61 | + $this->groupManager = $groupManager; |
|
62 | + $this->url = $urlGenerator; |
|
63 | + } |
|
64 | + |
|
65 | + /** |
|
66 | + * @param IEvent $event |
|
67 | + * @param string $subject |
|
68 | + * @param array $parameters |
|
69 | + */ |
|
70 | + protected function setSubjects(IEvent $event, $subject, array $parameters) { |
|
71 | + $placeholders = $replacements = []; |
|
72 | + foreach ($parameters as $placeholder => $parameter) { |
|
73 | + $placeholders[] = '{' . $placeholder . '}'; |
|
74 | + $replacements[] = $parameter['name']; |
|
75 | + } |
|
76 | + |
|
77 | + $event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) |
|
78 | + ->setRichSubject($subject, $parameters); |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * @param array $data |
|
83 | + * @param IL10N $l |
|
84 | + * @return array |
|
85 | + */ |
|
86 | + protected function generateCalendarParameter($data, IL10N $l) { |
|
87 | + if ($data['uri'] === CalDavBackend::PERSONAL_CALENDAR_URI && |
|
88 | + $data['name'] === CalDavBackend::PERSONAL_CALENDAR_NAME) { |
|
89 | + return [ |
|
90 | + 'type' => 'calendar', |
|
91 | + 'id' => $data['id'], |
|
92 | + 'name' => $l->t('Personal'), |
|
93 | + ]; |
|
94 | + } |
|
95 | + |
|
96 | + return [ |
|
97 | + 'type' => 'calendar', |
|
98 | + 'id' => $data['id'], |
|
99 | + 'name' => $data['name'], |
|
100 | + ]; |
|
101 | + } |
|
102 | + |
|
103 | + /** |
|
104 | + * @param int $id |
|
105 | + * @param string $name |
|
106 | + * @return array |
|
107 | + */ |
|
108 | + protected function generateLegacyCalendarParameter($id, $name) { |
|
109 | + return [ |
|
110 | + 'type' => 'calendar', |
|
111 | + 'id' => $id, |
|
112 | + 'name' => $name, |
|
113 | + ]; |
|
114 | + } |
|
115 | + |
|
116 | + /** |
|
117 | + * @param string $uid |
|
118 | + * @return array |
|
119 | + */ |
|
120 | + protected function generateUserParameter($uid) { |
|
121 | + if (!isset($this->userDisplayNames[$uid])) { |
|
122 | + $this->userDisplayNames[$uid] = $this->getUserDisplayName($uid); |
|
123 | + } |
|
124 | + |
|
125 | + return [ |
|
126 | + 'type' => 'user', |
|
127 | + 'id' => $uid, |
|
128 | + 'name' => $this->userDisplayNames[$uid], |
|
129 | + ]; |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * @param string $uid |
|
134 | + * @return string |
|
135 | + */ |
|
136 | + protected function getUserDisplayName($uid) { |
|
137 | + $user = $this->userManager->get($uid); |
|
138 | + if ($user instanceof IUser) { |
|
139 | + return $user->getDisplayName(); |
|
140 | + } |
|
141 | + return $uid; |
|
142 | + } |
|
143 | + |
|
144 | + /** |
|
145 | + * @param string $gid |
|
146 | + * @return array |
|
147 | + */ |
|
148 | + protected function generateGroupParameter($gid) { |
|
149 | + if (!isset($this->groupDisplayNames[$gid])) { |
|
150 | + $this->groupDisplayNames[$gid] = $this->getGroupDisplayName($gid); |
|
151 | + } |
|
152 | + |
|
153 | + return [ |
|
154 | + 'type' => 'user-group', |
|
155 | + 'id' => $gid, |
|
156 | + 'name' => $this->groupDisplayNames[$gid], |
|
157 | + ]; |
|
158 | + } |
|
159 | + |
|
160 | + /** |
|
161 | + * @param string $gid |
|
162 | + * @return string |
|
163 | + */ |
|
164 | + protected function getGroupDisplayName($gid) { |
|
165 | + $group = $this->groupManager->get($gid); |
|
166 | + if ($group instanceof IGroup) { |
|
167 | + return $group->getDisplayName(); |
|
168 | + } |
|
169 | + return $gid; |
|
170 | + } |
|
171 | 171 | } |
@@ -28,65 +28,65 @@ |
||
28 | 28 | |
29 | 29 | class Todo implements IFilter { |
30 | 30 | |
31 | - /** @var IL10N */ |
|
32 | - protected $l; |
|
31 | + /** @var IL10N */ |
|
32 | + protected $l; |
|
33 | 33 | |
34 | - /** @var IURLGenerator */ |
|
35 | - protected $url; |
|
34 | + /** @var IURLGenerator */ |
|
35 | + protected $url; |
|
36 | 36 | |
37 | - public function __construct(IL10N $l, IURLGenerator $url) { |
|
38 | - $this->l = $l; |
|
39 | - $this->url = $url; |
|
40 | - } |
|
37 | + public function __construct(IL10N $l, IURLGenerator $url) { |
|
38 | + $this->l = $l; |
|
39 | + $this->url = $url; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * @return string Lowercase a-z and underscore only identifier |
|
44 | - * @since 11.0.0 |
|
45 | - */ |
|
46 | - public function getIdentifier() { |
|
47 | - return 'calendar_todo'; |
|
48 | - } |
|
42 | + /** |
|
43 | + * @return string Lowercase a-z and underscore only identifier |
|
44 | + * @since 11.0.0 |
|
45 | + */ |
|
46 | + public function getIdentifier() { |
|
47 | + return 'calendar_todo'; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * @return string A translated string |
|
52 | - * @since 11.0.0 |
|
53 | - */ |
|
54 | - public function getName() { |
|
55 | - return $this->l->t('Todos'); |
|
56 | - } |
|
50 | + /** |
|
51 | + * @return string A translated string |
|
52 | + * @since 11.0.0 |
|
53 | + */ |
|
54 | + public function getName() { |
|
55 | + return $this->l->t('Todos'); |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @return int whether the filter should be rather on the top or bottom of |
|
60 | - * the admin section. The filters are arranged in ascending order of the |
|
61 | - * priority values. It is required to return a value between 0 and 100. |
|
62 | - * @since 11.0.0 |
|
63 | - */ |
|
64 | - public function getPriority() { |
|
65 | - return 40; |
|
66 | - } |
|
58 | + /** |
|
59 | + * @return int whether the filter should be rather on the top or bottom of |
|
60 | + * the admin section. The filters are arranged in ascending order of the |
|
61 | + * priority values. It is required to return a value between 0 and 100. |
|
62 | + * @since 11.0.0 |
|
63 | + */ |
|
64 | + public function getPriority() { |
|
65 | + return 40; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @return string Full URL to an icon, empty string when none is given |
|
70 | - * @since 11.0.0 |
|
71 | - */ |
|
72 | - public function getIcon() { |
|
73 | - return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg')); |
|
74 | - } |
|
68 | + /** |
|
69 | + * @return string Full URL to an icon, empty string when none is given |
|
70 | + * @since 11.0.0 |
|
71 | + */ |
|
72 | + public function getIcon() { |
|
73 | + return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg')); |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * @param string[] $types |
|
78 | - * @return string[] An array of allowed apps from which activities should be displayed |
|
79 | - * @since 11.0.0 |
|
80 | - */ |
|
81 | - public function filterTypes(array $types) { |
|
82 | - return array_intersect(['calendar_todo'], $types); |
|
83 | - } |
|
76 | + /** |
|
77 | + * @param string[] $types |
|
78 | + * @return string[] An array of allowed apps from which activities should be displayed |
|
79 | + * @since 11.0.0 |
|
80 | + */ |
|
81 | + public function filterTypes(array $types) { |
|
82 | + return array_intersect(['calendar_todo'], $types); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @return string[] An array of allowed apps from which activities should be displayed |
|
87 | - * @since 11.0.0 |
|
88 | - */ |
|
89 | - public function allowedApps() { |
|
90 | - return []; |
|
91 | - } |
|
85 | + /** |
|
86 | + * @return string[] An array of allowed apps from which activities should be displayed |
|
87 | + * @since 11.0.0 |
|
88 | + */ |
|
89 | + public function allowedApps() { |
|
90 | + return []; |
|
91 | + } |
|
92 | 92 | } |
@@ -39,136 +39,136 @@ |
||
39 | 39 | */ |
40 | 40 | class SystemTagNode implements \Sabre\DAV\INode { |
41 | 41 | |
42 | - /** |
|
43 | - * @var ISystemTag |
|
44 | - */ |
|
45 | - protected $tag; |
|
46 | - |
|
47 | - /** |
|
48 | - * @var ISystemTagManager |
|
49 | - */ |
|
50 | - protected $tagManager; |
|
51 | - |
|
52 | - /** |
|
53 | - * User |
|
54 | - * |
|
55 | - * @var IUser |
|
56 | - */ |
|
57 | - protected $user; |
|
58 | - |
|
59 | - /** |
|
60 | - * Whether to allow permissions for admins |
|
61 | - * |
|
62 | - * @var bool |
|
63 | - */ |
|
64 | - protected $isAdmin; |
|
65 | - |
|
66 | - /** |
|
67 | - * Sets up the node, expects a full path name |
|
68 | - * |
|
69 | - * @param ISystemTag $tag system tag |
|
70 | - * @param IUser $user user |
|
71 | - * @param bool $isAdmin whether to allow operations for admins |
|
72 | - * @param ISystemTagManager $tagManager tag manager |
|
73 | - */ |
|
74 | - public function __construct(ISystemTag $tag, IUser $user, $isAdmin, ISystemTagManager $tagManager) { |
|
75 | - $this->tag = $tag; |
|
76 | - $this->user = $user; |
|
77 | - $this->isAdmin = $isAdmin; |
|
78 | - $this->tagManager = $tagManager; |
|
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * Returns the id of the tag |
|
83 | - * |
|
84 | - * @return string |
|
85 | - */ |
|
86 | - public function getName() { |
|
87 | - return $this->tag->getId(); |
|
88 | - } |
|
89 | - |
|
90 | - /** |
|
91 | - * Returns the system tag represented by this node |
|
92 | - * |
|
93 | - * @return ISystemTag system tag |
|
94 | - */ |
|
95 | - public function getSystemTag() { |
|
96 | - return $this->tag; |
|
97 | - } |
|
98 | - |
|
99 | - /** |
|
100 | - * Renames the node |
|
101 | - * |
|
102 | - * @param string $name The new name |
|
103 | - * |
|
104 | - * @throws MethodNotAllowed not allowed to rename node |
|
105 | - */ |
|
106 | - public function setName($name) { |
|
107 | - throw new MethodNotAllowed(); |
|
108 | - } |
|
109 | - |
|
110 | - /** |
|
111 | - * Update tag |
|
112 | - * |
|
113 | - * @param string $name new tag name |
|
114 | - * @param bool $userVisible user visible |
|
115 | - * @param bool $userAssignable user assignable |
|
116 | - * @throws NotFound whenever the given tag id does not exist |
|
117 | - * @throws Forbidden whenever there is no permission to update said tag |
|
118 | - * @throws Conflict whenever a tag already exists with the given attributes |
|
119 | - */ |
|
120 | - public function update($name, $userVisible, $userAssignable) { |
|
121 | - try { |
|
122 | - if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
|
123 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
124 | - } |
|
125 | - if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
|
126 | - throw new Forbidden('No permission to update tag ' . $this->tag->getId()); |
|
127 | - } |
|
128 | - |
|
129 | - // only admin is able to change permissions, regular users can only rename |
|
130 | - if (!$this->isAdmin) { |
|
131 | - // only renaming is allowed for regular users |
|
132 | - if ($userVisible !== $this->tag->isUserVisible() |
|
133 | - || $userAssignable !== $this->tag->isUserAssignable() |
|
134 | - ) { |
|
135 | - throw new Forbidden('No permission to update permissions for tag ' . $this->tag->getId()); |
|
136 | - } |
|
137 | - } |
|
138 | - |
|
139 | - $this->tagManager->updateTag($this->tag->getId(), $name, $userVisible, $userAssignable); |
|
140 | - } catch (TagNotFoundException $e) { |
|
141 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
142 | - } catch (TagAlreadyExistsException $e) { |
|
143 | - throw new Conflict( |
|
144 | - 'Tag with the properties "' . $name . '", ' . |
|
145 | - $userVisible . ', ' . $userAssignable . ' already exists' |
|
146 | - ); |
|
147 | - } |
|
148 | - } |
|
149 | - |
|
150 | - /** |
|
151 | - * Returns null, not supported |
|
152 | - * |
|
153 | - */ |
|
154 | - public function getLastModified() { |
|
155 | - return null; |
|
156 | - } |
|
157 | - |
|
158 | - public function delete() { |
|
159 | - try { |
|
160 | - if (!$this->isAdmin) { |
|
161 | - throw new Forbidden('No permission to delete tag ' . $this->tag->getId()); |
|
162 | - } |
|
163 | - |
|
164 | - if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
|
165 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
166 | - } |
|
167 | - |
|
168 | - $this->tagManager->deleteTags($this->tag->getId()); |
|
169 | - } catch (TagNotFoundException $e) { |
|
170 | - // can happen if concurrent deletion occurred |
|
171 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
172 | - } |
|
173 | - } |
|
42 | + /** |
|
43 | + * @var ISystemTag |
|
44 | + */ |
|
45 | + protected $tag; |
|
46 | + |
|
47 | + /** |
|
48 | + * @var ISystemTagManager |
|
49 | + */ |
|
50 | + protected $tagManager; |
|
51 | + |
|
52 | + /** |
|
53 | + * User |
|
54 | + * |
|
55 | + * @var IUser |
|
56 | + */ |
|
57 | + protected $user; |
|
58 | + |
|
59 | + /** |
|
60 | + * Whether to allow permissions for admins |
|
61 | + * |
|
62 | + * @var bool |
|
63 | + */ |
|
64 | + protected $isAdmin; |
|
65 | + |
|
66 | + /** |
|
67 | + * Sets up the node, expects a full path name |
|
68 | + * |
|
69 | + * @param ISystemTag $tag system tag |
|
70 | + * @param IUser $user user |
|
71 | + * @param bool $isAdmin whether to allow operations for admins |
|
72 | + * @param ISystemTagManager $tagManager tag manager |
|
73 | + */ |
|
74 | + public function __construct(ISystemTag $tag, IUser $user, $isAdmin, ISystemTagManager $tagManager) { |
|
75 | + $this->tag = $tag; |
|
76 | + $this->user = $user; |
|
77 | + $this->isAdmin = $isAdmin; |
|
78 | + $this->tagManager = $tagManager; |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * Returns the id of the tag |
|
83 | + * |
|
84 | + * @return string |
|
85 | + */ |
|
86 | + public function getName() { |
|
87 | + return $this->tag->getId(); |
|
88 | + } |
|
89 | + |
|
90 | + /** |
|
91 | + * Returns the system tag represented by this node |
|
92 | + * |
|
93 | + * @return ISystemTag system tag |
|
94 | + */ |
|
95 | + public function getSystemTag() { |
|
96 | + return $this->tag; |
|
97 | + } |
|
98 | + |
|
99 | + /** |
|
100 | + * Renames the node |
|
101 | + * |
|
102 | + * @param string $name The new name |
|
103 | + * |
|
104 | + * @throws MethodNotAllowed not allowed to rename node |
|
105 | + */ |
|
106 | + public function setName($name) { |
|
107 | + throw new MethodNotAllowed(); |
|
108 | + } |
|
109 | + |
|
110 | + /** |
|
111 | + * Update tag |
|
112 | + * |
|
113 | + * @param string $name new tag name |
|
114 | + * @param bool $userVisible user visible |
|
115 | + * @param bool $userAssignable user assignable |
|
116 | + * @throws NotFound whenever the given tag id does not exist |
|
117 | + * @throws Forbidden whenever there is no permission to update said tag |
|
118 | + * @throws Conflict whenever a tag already exists with the given attributes |
|
119 | + */ |
|
120 | + public function update($name, $userVisible, $userAssignable) { |
|
121 | + try { |
|
122 | + if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
|
123 | + throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
124 | + } |
|
125 | + if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
|
126 | + throw new Forbidden('No permission to update tag ' . $this->tag->getId()); |
|
127 | + } |
|
128 | + |
|
129 | + // only admin is able to change permissions, regular users can only rename |
|
130 | + if (!$this->isAdmin) { |
|
131 | + // only renaming is allowed for regular users |
|
132 | + if ($userVisible !== $this->tag->isUserVisible() |
|
133 | + || $userAssignable !== $this->tag->isUserAssignable() |
|
134 | + ) { |
|
135 | + throw new Forbidden('No permission to update permissions for tag ' . $this->tag->getId()); |
|
136 | + } |
|
137 | + } |
|
138 | + |
|
139 | + $this->tagManager->updateTag($this->tag->getId(), $name, $userVisible, $userAssignable); |
|
140 | + } catch (TagNotFoundException $e) { |
|
141 | + throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
142 | + } catch (TagAlreadyExistsException $e) { |
|
143 | + throw new Conflict( |
|
144 | + 'Tag with the properties "' . $name . '", ' . |
|
145 | + $userVisible . ', ' . $userAssignable . ' already exists' |
|
146 | + ); |
|
147 | + } |
|
148 | + } |
|
149 | + |
|
150 | + /** |
|
151 | + * Returns null, not supported |
|
152 | + * |
|
153 | + */ |
|
154 | + public function getLastModified() { |
|
155 | + return null; |
|
156 | + } |
|
157 | + |
|
158 | + public function delete() { |
|
159 | + try { |
|
160 | + if (!$this->isAdmin) { |
|
161 | + throw new Forbidden('No permission to delete tag ' . $this->tag->getId()); |
|
162 | + } |
|
163 | + |
|
164 | + if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
|
165 | + throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
166 | + } |
|
167 | + |
|
168 | + $this->tagManager->deleteTags($this->tag->getId()); |
|
169 | + } catch (TagNotFoundException $e) { |
|
170 | + // can happen if concurrent deletion occurred |
|
171 | + throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
172 | + } |
|
173 | + } |
|
174 | 174 | } |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | public function update($name, $userVisible, $userAssignable) { |
121 | 121 | try { |
122 | 122 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
123 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
123 | + throw new NotFound('Tag with id '.$this->tag->getId().' does not exist'); |
|
124 | 124 | } |
125 | 125 | if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
126 | - throw new Forbidden('No permission to update tag ' . $this->tag->getId()); |
|
126 | + throw new Forbidden('No permission to update tag '.$this->tag->getId()); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // only admin is able to change permissions, regular users can only rename |
@@ -132,17 +132,17 @@ discard block |
||
132 | 132 | if ($userVisible !== $this->tag->isUserVisible() |
133 | 133 | || $userAssignable !== $this->tag->isUserAssignable() |
134 | 134 | ) { |
135 | - throw new Forbidden('No permission to update permissions for tag ' . $this->tag->getId()); |
|
135 | + throw new Forbidden('No permission to update permissions for tag '.$this->tag->getId()); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
139 | 139 | $this->tagManager->updateTag($this->tag->getId(), $name, $userVisible, $userAssignable); |
140 | 140 | } catch (TagNotFoundException $e) { |
141 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
141 | + throw new NotFound('Tag with id '.$this->tag->getId().' does not exist'); |
|
142 | 142 | } catch (TagAlreadyExistsException $e) { |
143 | 143 | throw new Conflict( |
144 | - 'Tag with the properties "' . $name . '", ' . |
|
145 | - $userVisible . ', ' . $userAssignable . ' already exists' |
|
144 | + 'Tag with the properties "'.$name.'", '. |
|
145 | + $userVisible.', '.$userAssignable.' already exists' |
|
146 | 146 | ); |
147 | 147 | } |
148 | 148 | } |
@@ -158,17 +158,17 @@ discard block |
||
158 | 158 | public function delete() { |
159 | 159 | try { |
160 | 160 | if (!$this->isAdmin) { |
161 | - throw new Forbidden('No permission to delete tag ' . $this->tag->getId()); |
|
161 | + throw new Forbidden('No permission to delete tag '.$this->tag->getId()); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
165 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
165 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | $this->tagManager->deleteTags($this->tag->getId()); |
169 | 169 | } catch (TagNotFoundException $e) { |
170 | 170 | // can happen if concurrent deletion occurred |
171 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
171 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found', 0, $e); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
@@ -37,134 +37,134 @@ |
||
37 | 37 | * Mapping node for system tag to object id |
38 | 38 | */ |
39 | 39 | class SystemTagMappingNode implements \Sabre\DAV\INode { |
40 | - /** |
|
41 | - * @var ISystemTag |
|
42 | - */ |
|
43 | - protected $tag; |
|
44 | - |
|
45 | - /** |
|
46 | - * @var string |
|
47 | - */ |
|
48 | - private $objectId; |
|
49 | - |
|
50 | - /** |
|
51 | - * @var string |
|
52 | - */ |
|
53 | - private $objectType; |
|
54 | - |
|
55 | - /** |
|
56 | - * User |
|
57 | - * |
|
58 | - * @var IUser |
|
59 | - */ |
|
60 | - protected $user; |
|
61 | - |
|
62 | - /** |
|
63 | - * @var ISystemTagManager |
|
64 | - */ |
|
65 | - protected $tagManager; |
|
66 | - |
|
67 | - /** |
|
68 | - * @var ISystemTagObjectMapper |
|
69 | - */ |
|
70 | - private $tagMapper; |
|
71 | - |
|
72 | - /** |
|
73 | - * Sets up the node, expects a full path name |
|
74 | - * |
|
75 | - * @param ISystemTag $tag system tag |
|
76 | - * @param string $objectId |
|
77 | - * @param string $objectType |
|
78 | - * @param IUser $user user |
|
79 | - * @param ISystemTagManager $tagManager |
|
80 | - * @param ISystemTagObjectMapper $tagMapper |
|
81 | - */ |
|
82 | - public function __construct( |
|
83 | - ISystemTag $tag, |
|
84 | - $objectId, |
|
85 | - $objectType, |
|
86 | - IUser $user, |
|
87 | - ISystemTagManager $tagManager, |
|
88 | - ISystemTagObjectMapper $tagMapper |
|
89 | - ) { |
|
90 | - $this->tag = $tag; |
|
91 | - $this->objectId = $objectId; |
|
92 | - $this->objectType = $objectType; |
|
93 | - $this->user = $user; |
|
94 | - $this->tagManager = $tagManager; |
|
95 | - $this->tagMapper = $tagMapper; |
|
96 | - } |
|
97 | - |
|
98 | - /** |
|
99 | - * Returns the object id of the relationship |
|
100 | - * |
|
101 | - * @return string object id |
|
102 | - */ |
|
103 | - public function getObjectId() { |
|
104 | - return $this->objectId; |
|
105 | - } |
|
106 | - |
|
107 | - /** |
|
108 | - * Returns the object type of the relationship |
|
109 | - * |
|
110 | - * @return string object type |
|
111 | - */ |
|
112 | - public function getObjectType() { |
|
113 | - return $this->objectType; |
|
114 | - } |
|
115 | - |
|
116 | - /** |
|
117 | - * Returns the system tag represented by this node |
|
118 | - * |
|
119 | - * @return ISystemTag system tag |
|
120 | - */ |
|
121 | - public function getSystemTag() { |
|
122 | - return $this->tag; |
|
123 | - } |
|
124 | - |
|
125 | - /** |
|
126 | - * Returns the id of the tag |
|
127 | - * |
|
128 | - * @return string |
|
129 | - */ |
|
130 | - public function getName() { |
|
131 | - return $this->tag->getId(); |
|
132 | - } |
|
133 | - |
|
134 | - /** |
|
135 | - * Renames the node |
|
136 | - * |
|
137 | - * @param string $name The new name |
|
138 | - * |
|
139 | - * @throws MethodNotAllowed not allowed to rename node |
|
140 | - */ |
|
141 | - public function setName($name) { |
|
142 | - throw new MethodNotAllowed(); |
|
143 | - } |
|
144 | - |
|
145 | - /** |
|
146 | - * Returns null, not supported |
|
147 | - * |
|
148 | - */ |
|
149 | - public function getLastModified() { |
|
150 | - return null; |
|
151 | - } |
|
152 | - |
|
153 | - /** |
|
154 | - * Delete tag to object association |
|
155 | - */ |
|
156 | - public function delete() { |
|
157 | - try { |
|
158 | - if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
|
159 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
160 | - } |
|
161 | - if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
|
162 | - throw new Forbidden('No permission to unassign tag ' . $this->tag->getId()); |
|
163 | - } |
|
164 | - $this->tagMapper->unassignTags($this->objectId, $this->objectType, $this->tag->getId()); |
|
165 | - } catch (TagNotFoundException $e) { |
|
166 | - // can happen if concurrent deletion occurred |
|
167 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
168 | - } |
|
169 | - } |
|
40 | + /** |
|
41 | + * @var ISystemTag |
|
42 | + */ |
|
43 | + protected $tag; |
|
44 | + |
|
45 | + /** |
|
46 | + * @var string |
|
47 | + */ |
|
48 | + private $objectId; |
|
49 | + |
|
50 | + /** |
|
51 | + * @var string |
|
52 | + */ |
|
53 | + private $objectType; |
|
54 | + |
|
55 | + /** |
|
56 | + * User |
|
57 | + * |
|
58 | + * @var IUser |
|
59 | + */ |
|
60 | + protected $user; |
|
61 | + |
|
62 | + /** |
|
63 | + * @var ISystemTagManager |
|
64 | + */ |
|
65 | + protected $tagManager; |
|
66 | + |
|
67 | + /** |
|
68 | + * @var ISystemTagObjectMapper |
|
69 | + */ |
|
70 | + private $tagMapper; |
|
71 | + |
|
72 | + /** |
|
73 | + * Sets up the node, expects a full path name |
|
74 | + * |
|
75 | + * @param ISystemTag $tag system tag |
|
76 | + * @param string $objectId |
|
77 | + * @param string $objectType |
|
78 | + * @param IUser $user user |
|
79 | + * @param ISystemTagManager $tagManager |
|
80 | + * @param ISystemTagObjectMapper $tagMapper |
|
81 | + */ |
|
82 | + public function __construct( |
|
83 | + ISystemTag $tag, |
|
84 | + $objectId, |
|
85 | + $objectType, |
|
86 | + IUser $user, |
|
87 | + ISystemTagManager $tagManager, |
|
88 | + ISystemTagObjectMapper $tagMapper |
|
89 | + ) { |
|
90 | + $this->tag = $tag; |
|
91 | + $this->objectId = $objectId; |
|
92 | + $this->objectType = $objectType; |
|
93 | + $this->user = $user; |
|
94 | + $this->tagManager = $tagManager; |
|
95 | + $this->tagMapper = $tagMapper; |
|
96 | + } |
|
97 | + |
|
98 | + /** |
|
99 | + * Returns the object id of the relationship |
|
100 | + * |
|
101 | + * @return string object id |
|
102 | + */ |
|
103 | + public function getObjectId() { |
|
104 | + return $this->objectId; |
|
105 | + } |
|
106 | + |
|
107 | + /** |
|
108 | + * Returns the object type of the relationship |
|
109 | + * |
|
110 | + * @return string object type |
|
111 | + */ |
|
112 | + public function getObjectType() { |
|
113 | + return $this->objectType; |
|
114 | + } |
|
115 | + |
|
116 | + /** |
|
117 | + * Returns the system tag represented by this node |
|
118 | + * |
|
119 | + * @return ISystemTag system tag |
|
120 | + */ |
|
121 | + public function getSystemTag() { |
|
122 | + return $this->tag; |
|
123 | + } |
|
124 | + |
|
125 | + /** |
|
126 | + * Returns the id of the tag |
|
127 | + * |
|
128 | + * @return string |
|
129 | + */ |
|
130 | + public function getName() { |
|
131 | + return $this->tag->getId(); |
|
132 | + } |
|
133 | + |
|
134 | + /** |
|
135 | + * Renames the node |
|
136 | + * |
|
137 | + * @param string $name The new name |
|
138 | + * |
|
139 | + * @throws MethodNotAllowed not allowed to rename node |
|
140 | + */ |
|
141 | + public function setName($name) { |
|
142 | + throw new MethodNotAllowed(); |
|
143 | + } |
|
144 | + |
|
145 | + /** |
|
146 | + * Returns null, not supported |
|
147 | + * |
|
148 | + */ |
|
149 | + public function getLastModified() { |
|
150 | + return null; |
|
151 | + } |
|
152 | + |
|
153 | + /** |
|
154 | + * Delete tag to object association |
|
155 | + */ |
|
156 | + public function delete() { |
|
157 | + try { |
|
158 | + if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
|
159 | + throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
160 | + } |
|
161 | + if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
|
162 | + throw new Forbidden('No permission to unassign tag ' . $this->tag->getId()); |
|
163 | + } |
|
164 | + $this->tagMapper->unassignTags($this->objectId, $this->objectType, $this->tag->getId()); |
|
165 | + } catch (TagNotFoundException $e) { |
|
166 | + // can happen if concurrent deletion occurred |
|
167 | + throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
168 | + } |
|
169 | + } |
|
170 | 170 | } |
@@ -156,15 +156,15 @@ |
||
156 | 156 | public function delete() { |
157 | 157 | try { |
158 | 158 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
159 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
159 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found'); |
|
160 | 160 | } |
161 | 161 | if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
162 | - throw new Forbidden('No permission to unassign tag ' . $this->tag->getId()); |
|
162 | + throw new Forbidden('No permission to unassign tag '.$this->tag->getId()); |
|
163 | 163 | } |
164 | 164 | $this->tagMapper->unassignTags($this->objectId, $this->objectType, $this->tag->getId()); |
165 | 165 | } catch (TagNotFoundException $e) { |
166 | 166 | // can happen if concurrent deletion occurred |
167 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
167 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found', 0, $e); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
@@ -29,16 +29,16 @@ |
||
29 | 29 | |
30 | 30 | class Capabilities implements ICapability { |
31 | 31 | |
32 | - /** |
|
33 | - * Return this classes capabilities |
|
34 | - * |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function getCapabilities() { |
|
38 | - return [ |
|
39 | - 'files' => [ |
|
40 | - 'versioning' => true |
|
41 | - ] |
|
42 | - ]; |
|
43 | - } |
|
32 | + /** |
|
33 | + * Return this classes capabilities |
|
34 | + * |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function getCapabilities() { |
|
38 | + return [ |
|
39 | + 'files' => [ |
|
40 | + 'versioning' => true |
|
41 | + ] |
|
42 | + ]; |
|
43 | + } |
|
44 | 44 | } |
@@ -29,43 +29,43 @@ |
||
29 | 29 | */ |
30 | 30 | interface IFilter { |
31 | 31 | |
32 | - /** |
|
33 | - * @return string Lowercase a-z and underscore only identifier |
|
34 | - * @since 11.0.0 |
|
35 | - */ |
|
36 | - public function getIdentifier(); |
|
32 | + /** |
|
33 | + * @return string Lowercase a-z and underscore only identifier |
|
34 | + * @since 11.0.0 |
|
35 | + */ |
|
36 | + public function getIdentifier(); |
|
37 | 37 | |
38 | - /** |
|
39 | - * @return string A translated string |
|
40 | - * @since 11.0.0 |
|
41 | - */ |
|
42 | - public function getName(); |
|
38 | + /** |
|
39 | + * @return string A translated string |
|
40 | + * @since 11.0.0 |
|
41 | + */ |
|
42 | + public function getName(); |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return int whether the filter should be rather on the top or bottom of |
|
46 | - * the admin section. The filters are arranged in ascending order of the |
|
47 | - * priority values. It is required to return a value between 0 and 100. |
|
48 | - * @since 11.0.0 |
|
49 | - */ |
|
50 | - public function getPriority(); |
|
44 | + /** |
|
45 | + * @return int whether the filter should be rather on the top or bottom of |
|
46 | + * the admin section. The filters are arranged in ascending order of the |
|
47 | + * priority values. It is required to return a value between 0 and 100. |
|
48 | + * @since 11.0.0 |
|
49 | + */ |
|
50 | + public function getPriority(); |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return string Full URL to an icon, empty string when none is given |
|
54 | - * @since 11.0.0 |
|
55 | - */ |
|
56 | - public function getIcon(); |
|
52 | + /** |
|
53 | + * @return string Full URL to an icon, empty string when none is given |
|
54 | + * @since 11.0.0 |
|
55 | + */ |
|
56 | + public function getIcon(); |
|
57 | 57 | |
58 | - /** |
|
59 | - * @param string[] $types |
|
60 | - * @return string[] An array of allowed apps from which activities should be displayed |
|
61 | - * @since 11.0.0 |
|
62 | - */ |
|
63 | - public function filterTypes(array $types); |
|
58 | + /** |
|
59 | + * @param string[] $types |
|
60 | + * @return string[] An array of allowed apps from which activities should be displayed |
|
61 | + * @since 11.0.0 |
|
62 | + */ |
|
63 | + public function filterTypes(array $types); |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return string[] An array of allowed apps from which activities should be displayed |
|
67 | - * @since 11.0.0 |
|
68 | - */ |
|
69 | - public function allowedApps(); |
|
65 | + /** |
|
66 | + * @return string[] An array of allowed apps from which activities should be displayed |
|
67 | + * @since 11.0.0 |
|
68 | + */ |
|
69 | + public function allowedApps(); |
|
70 | 70 | } |
71 | 71 |
@@ -30,35 +30,35 @@ |
||
30 | 30 | */ |
31 | 31 | interface IEventMerger { |
32 | 32 | |
33 | - /** |
|
34 | - * Combines two events when possible to have grouping: |
|
35 | - * |
|
36 | - * Example1: Two events with subject '{user} created {file}' and |
|
37 | - * $mergeParameter file with different file and same user will be merged |
|
38 | - * to '{user} created {file1} and {file2}' and the childEvent on the return |
|
39 | - * will be set, if the events have been merged. |
|
40 | - * |
|
41 | - * Example2: Two events with subject '{user} created {file}' and |
|
42 | - * $mergeParameter file with same file and same user will be merged to |
|
43 | - * '{user} created {file1}' and the childEvent on the return will be set, if |
|
44 | - * the events have been merged. |
|
45 | - * |
|
46 | - * The following requirements have to be met, in order to be merged: |
|
47 | - * - Both events need to have the same `getApp()` |
|
48 | - * - Both events must not have a message `getMessage()` |
|
49 | - * - Both events need to have the same subject `getSubject()` |
|
50 | - * - Both events need to have the same object type `getObjectType()` |
|
51 | - * - The time difference between both events must not be bigger then 3 hours |
|
52 | - * - Only up to 5 events can be merged. |
|
53 | - * - All parameters apart from such starting with $mergeParameter must be |
|
54 | - * the same for both events. |
|
55 | - * |
|
56 | - * @param string $mergeParameter |
|
57 | - * @param IEvent $event |
|
58 | - * @param IEvent|null $previousEvent |
|
59 | - * @return IEvent |
|
60 | - * @since 11.0 |
|
61 | - */ |
|
62 | - public function mergeEvents($mergeParameter, IEvent $event, IEvent $previousEvent = null); |
|
33 | + /** |
|
34 | + * Combines two events when possible to have grouping: |
|
35 | + * |
|
36 | + * Example1: Two events with subject '{user} created {file}' and |
|
37 | + * $mergeParameter file with different file and same user will be merged |
|
38 | + * to '{user} created {file1} and {file2}' and the childEvent on the return |
|
39 | + * will be set, if the events have been merged. |
|
40 | + * |
|
41 | + * Example2: Two events with subject '{user} created {file}' and |
|
42 | + * $mergeParameter file with same file and same user will be merged to |
|
43 | + * '{user} created {file1}' and the childEvent on the return will be set, if |
|
44 | + * the events have been merged. |
|
45 | + * |
|
46 | + * The following requirements have to be met, in order to be merged: |
|
47 | + * - Both events need to have the same `getApp()` |
|
48 | + * - Both events must not have a message `getMessage()` |
|
49 | + * - Both events need to have the same subject `getSubject()` |
|
50 | + * - Both events need to have the same object type `getObjectType()` |
|
51 | + * - The time difference between both events must not be bigger then 3 hours |
|
52 | + * - Only up to 5 events can be merged. |
|
53 | + * - All parameters apart from such starting with $mergeParameter must be |
|
54 | + * the same for both events. |
|
55 | + * |
|
56 | + * @param string $mergeParameter |
|
57 | + * @param IEvent $event |
|
58 | + * @param IEvent|null $previousEvent |
|
59 | + * @return IEvent |
|
60 | + * @since 11.0 |
|
61 | + */ |
|
62 | + public function mergeEvents($mergeParameter, IEvent $event, IEvent $previousEvent = null); |
|
63 | 63 | |
64 | 64 | } |
@@ -29,48 +29,48 @@ |
||
29 | 29 | */ |
30 | 30 | interface ISetting { |
31 | 31 | |
32 | - /** |
|
33 | - * @return string Lowercase a-z and underscore only identifier |
|
34 | - * @since 11.0.0 |
|
35 | - */ |
|
36 | - public function getIdentifier(); |
|
32 | + /** |
|
33 | + * @return string Lowercase a-z and underscore only identifier |
|
34 | + * @since 11.0.0 |
|
35 | + */ |
|
36 | + public function getIdentifier(); |
|
37 | 37 | |
38 | - /** |
|
39 | - * @return string A translated string |
|
40 | - * @since 11.0.0 |
|
41 | - */ |
|
42 | - public function getName(); |
|
38 | + /** |
|
39 | + * @return string A translated string |
|
40 | + * @since 11.0.0 |
|
41 | + */ |
|
42 | + public function getName(); |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return int whether the filter should be rather on the top or bottom of |
|
46 | - * the admin section. The filters are arranged in ascending order of the |
|
47 | - * priority values. It is required to return a value between 0 and 100. |
|
48 | - * @since 11.0.0 |
|
49 | - */ |
|
50 | - public function getPriority(); |
|
44 | + /** |
|
45 | + * @return int whether the filter should be rather on the top or bottom of |
|
46 | + * the admin section. The filters are arranged in ascending order of the |
|
47 | + * priority values. It is required to return a value between 0 and 100. |
|
48 | + * @since 11.0.0 |
|
49 | + */ |
|
50 | + public function getPriority(); |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return bool True when the option can be changed for the stream |
|
54 | - * @since 11.0.0 |
|
55 | - */ |
|
56 | - public function canChangeStream(); |
|
52 | + /** |
|
53 | + * @return bool True when the option can be changed for the stream |
|
54 | + * @since 11.0.0 |
|
55 | + */ |
|
56 | + public function canChangeStream(); |
|
57 | 57 | |
58 | - /** |
|
59 | - * @return bool True when the option can be changed for the stream |
|
60 | - * @since 11.0.0 |
|
61 | - */ |
|
62 | - public function isDefaultEnabledStream(); |
|
58 | + /** |
|
59 | + * @return bool True when the option can be changed for the stream |
|
60 | + * @since 11.0.0 |
|
61 | + */ |
|
62 | + public function isDefaultEnabledStream(); |
|
63 | 63 | |
64 | - /** |
|
65 | - * @return bool True when the option can be changed for the mail |
|
66 | - * @since 11.0.0 |
|
67 | - */ |
|
68 | - public function canChangeMail(); |
|
64 | + /** |
|
65 | + * @return bool True when the option can be changed for the mail |
|
66 | + * @since 11.0.0 |
|
67 | + */ |
|
68 | + public function canChangeMail(); |
|
69 | 69 | |
70 | - /** |
|
71 | - * @return bool True when the option can be changed for the stream |
|
72 | - * @since 11.0.0 |
|
73 | - */ |
|
74 | - public function isDefaultEnabledMail(); |
|
70 | + /** |
|
71 | + * @return bool True when the option can be changed for the stream |
|
72 | + * @since 11.0.0 |
|
73 | + */ |
|
74 | + public function isDefaultEnabledMail(); |
|
75 | 75 | } |
76 | 76 |
@@ -28,15 +28,15 @@ |
||
28 | 28 | * @since 11.0.0 |
29 | 29 | */ |
30 | 30 | interface IProvider { |
31 | - /** |
|
32 | - * @param string $language The language which should be used for translating, e.g. "en" |
|
33 | - * @param IEvent $event The current event which should be parsed |
|
34 | - * @param IEvent|null $previousEvent A potential previous event which you can combine with the current one. |
|
35 | - * To do so, simply use setChildEvent($previousEvent) after setting the |
|
36 | - * combined subject on the current event. |
|
37 | - * @return IEvent |
|
38 | - * @throws \InvalidArgumentException Should be thrown if your provider does not know this event |
|
39 | - * @since 11.0.0 |
|
40 | - */ |
|
41 | - public function parse($language, IEvent $event, IEvent $previousEvent = null); |
|
31 | + /** |
|
32 | + * @param string $language The language which should be used for translating, e.g. "en" |
|
33 | + * @param IEvent $event The current event which should be parsed |
|
34 | + * @param IEvent|null $previousEvent A potential previous event which you can combine with the current one. |
|
35 | + * To do so, simply use setChildEvent($previousEvent) after setting the |
|
36 | + * combined subject on the current event. |
|
37 | + * @return IEvent |
|
38 | + * @throws \InvalidArgumentException Should be thrown if your provider does not know this event |
|
39 | + * @since 11.0.0 |
|
40 | + */ |
|
41 | + public function parse($language, IEvent $event, IEvent $previousEvent = null); |
|
42 | 42 | } |