Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/activity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-12-13 16:23:39 +0300
committerJoas Schilling <coding@schilljs.com>2016-12-13 16:23:55 +0300
commit54bec965a14a9015f96044cca59034ad8b03326b (patch)
tree8d63f3dd81a06b68fc9997b2174f26c7c4152807 /docs
parent2282b35a7c1cb8a6df8429fc94ae0f05400cf5e7 (diff)
Fix comments
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/create.md13
-rw-r--r--docs/provider.md6
-rw-r--r--docs/setting.md6
3 files changed, 16 insertions, 9 deletions
diff --git a/docs/create.md b/docs/create.md
index 686a15c0..8a2c0472 100644
--- a/docs/create.md
+++ b/docs/create.md
@@ -3,15 +3,20 @@
To create and publish an event to the activity app, a new `IEvent` should be fetched from the activity manager and afterwards be passed to the `publish()` method:
```php
-$event = \OC::$server->getActivityManager()->createEvent();
+// The activity manager should be automatically injected
+// by the type hint OCP\Activity\IManager, when inside a class.
+// When you have a plain file without a class, you can use
+// \OC::$server->getActivityManager() instead.
+
+$event = $this->activityManager->createEvent();
...
-\OC::$server->getActivityManager()->publish($event);
+$this->activityManager->->publish($event);
```
-Tthe following values **must** be set, before publishing an event:
+The following values **must** be set before publishing an event:
* `setApp()`
-* `setType()`
+* `setType()` - this must match an `ISetting::getIdentifier()`
* `setAffectedUser()`
* `setAuthor()`
* `setTimestamp()`
diff --git a/docs/provider.md b/docs/provider.md
index 72e5792f..33584ee3 100644
--- a/docs/provider.md
+++ b/docs/provider.md
@@ -33,7 +33,7 @@ Additionally the following methods *should* be called, in order to beautify the
### Check responsibility
-The first thing the provider should do, is to check whether the `IEvent` is on it cares about. A simple check for the app and maybe additionally the type, if the app has more then one provider, should be enough:
+The first thing the provider should do, is to check whether the `IEvent` is one it cares about. A simple check for the app and maybe additionally the type, if the app has more then one provider, should be enough:
```php
if ($event->getApp() !== 'files' || $event->getType() !== 'favorite') {
@@ -53,12 +53,12 @@ The favorite provider makes use of this and the activities don't have additional
### Long translations with "rich object" string
-In the long version for the normal activity stream contains the filename. Objects like users , files and more can be highlighted in the "rich subject", which allows the app to show an avatar next to the name, link the file name to the file list, and many more things.
+In the long version for the normal activity stream contains the filename. Objects like users, files and more can be highlighted in the "rich subject", which allows the app to show an avatar next to the name, link the file name to the file list and many more things.
The `IEvent::setRichSubject()` method has two arguments:
1. The already translated string with placeholders
-2. The list of placeholders, in the case of the favorite provider it's the file that was favorites
+2. The list of placeholders, in the case of the favorite provider it's the file that was marked as a favorite
```php
$event->setRichSubject(
diff --git a/docs/setting.md b/docs/setting.md
index 8e79e7c0..b86308fe 100644
--- a/docs/setting.md
+++ b/docs/setting.md
@@ -23,9 +23,11 @@ The `setting` value is the fully namespaced class name of the `ISetting` impleme
The identifier is also used as a HTML ID, therefor only lowercase a-z and underscores are allowed.
+**Note:** This must also match the value that is used in the `IEvent::setType()` of the event, otherwise the event will not be visible.
+
## Name
-The name **must** already be translated and should bea short and descriptive sentence. One or two important words can also be highlighted using the `<strong>` HTML tag, to allow easier recognition of the setting.
+The name **must** already be translated and should be a short and descriptive sentence. One or two important words can also be highlighted using the `<strong>` HTML tag, to allow easier recognition of the setting.
## Icon
@@ -37,7 +39,7 @@ Priority should technically be a value between 0-100, where 0 means it's listed
## Is default enabled stream / mail
-The two "is default enabled x" booleans specify whether the setting is enabled or disabled by default for the stream or mail. Once a user changed their setting, the default is not used for them anymore. Changing the default is therefor not "retro active".
+The two "is default enabled x" booleans specify whether the setting is enabled or disabled by default for the stream or mail. Once a user changed their setting, the default is not used for them anymore. Changing the default is therefore not "retro active".
## Can change stream / mail