diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2015-02-13 11:51:55 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2015-02-13 11:55:06 +0100 |
commit | 6c349c00bb7ce3c43a44588de5cf158158d2990b (patch) | |
tree | 3b91764277e29ad537de6157ce6831d7521b4e02 /lib/private/activitymanager.php | |
parent | be63e18b0aaf403dab86b3b42500e5e4b18183e4 (diff) | |
download | nextcloud-server-6c349c00bb7ce3c43a44588de5cf158158d2990b.tar.gz nextcloud-server-6c349c00bb7ce3c43a44588de5cf158158d2990b.zip |
Order methods to by grouped by their task
Diffstat (limited to 'lib/private/activitymanager.php')
-rw-r--r-- | lib/private/activitymanager.php | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/lib/private/activitymanager.php b/lib/private/activitymanager.php index ee7059d492d..24acb5d5f69 100644 --- a/lib/private/activitymanager.php +++ b/lib/private/activitymanager.php @@ -122,43 +122,45 @@ class ActivityManager implements IManager { } /** - * @param array $types - * @param string $filter + * @param string $method * @return array */ - function filterNotificationTypes($types, $filter) { - if (!$this->isFilterValid($filter)) { - return $types; - } - + function getDefaultTypes($method) { + $defaultTypes = array(); foreach($this->extensions as $extension) { $c = $extension(); if ($c instanceof IExtension) { - $result = $c->filterNotificationTypes($types, $filter); - if (is_array($result)) { - $types = $result; + $types = $c->getDefaultTypes($method); + if (is_array($types)) { + $defaultTypes = array_merge($types, $defaultTypes); } } } - return $types; + return $defaultTypes; } /** - * @param string $method - * @return array + * @param string $type + * @return string */ - function getDefaultTypes($method) { - $defaultTypes = array(); + function getTypeIcon($type) { + if (isset($this->typeIcons[$type])) { + return $this->typeIcons[$type]; + } + foreach($this->extensions as $extension) { $c = $extension(); if ($c instanceof IExtension) { - $types = $c->getDefaultTypes($method); - if (is_array($types)) { - $defaultTypes = array_merge($types, $defaultTypes); + $icon = $c->getTypeIcon($type); + if (is_string($icon)) { + $this->typeIcons[$type] = $icon; + return $icon; } } } - return $defaultTypes; + + $this->typeIcons[$type] = ''; + return ''; } /** @@ -214,30 +216,6 @@ class ActivityManager implements IManager { } /** - * @param string $type - * @return string - */ - function getTypeIcon($type) { - if (isset($this->typeIcons[$type])) { - return $this->typeIcons[$type]; - } - - foreach($this->extensions as $extension) { - $c = $extension(); - if ($c instanceof IExtension) { - $icon = $c->getTypeIcon($type); - if (is_string($icon)) { - $this->typeIcons[$type] = $icon; - return $icon; - } - } - } - - $this->typeIcons[$type] = ''; - return ''; - } - - /** * @param array $activity * @return integer|false */ @@ -301,6 +279,28 @@ class ActivityManager implements IManager { } /** + * @param array $types + * @param string $filter + * @return array + */ + function filterNotificationTypes($types, $filter) { + if (!$this->isFilterValid($filter)) { + return $types; + } + + foreach($this->extensions as $extension) { + $c = $extension(); + if ($c instanceof IExtension) { + $result = $c->filterNotificationTypes($types, $filter); + if (is_array($result)) { + $types = $result; + } + } + } + return $types; + } + + /** * @param string $filter * @return array */ |