diff options
author | cash <cash.costello@gmail.com> | 2012-02-04 14:26:32 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2012-02-04 14:26:32 -0500 |
commit | e428dbd281c22e65e8cc00d1095ce4564c9dd1bf (patch) | |
tree | 38dd70114b0f3e218495c57dd748b9c6220c3cf5 | |
parent | 601ec5ccf5eb6940ca468b31e1b400412697c8cb (diff) | |
download | elgg-e428dbd281c22e65e8cc00d1095ce4564c9dd1bf.tar.gz elgg-e428dbd281c22e65e8cc00d1095ce4564c9dd1bf.tar.bz2 |
Fixes #4310 adds missing blog notification function
-rw-r--r-- | mod/blog/languages/en.php | 1 | ||||
-rw-r--r-- | mod/blog/start.php | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php index 8a21c1f8d..42606bf8e 100644 --- a/mod/blog/languages/en.php +++ b/mod/blog/languages/en.php @@ -58,6 +58,7 @@ $english = array( // notifications 'blog:newpost' => 'A new blog post', + 'blog:via' => "published a blog post", // widget 'blog:widget:description' => 'Display your latest blog posts', diff --git a/mod/blog/start.php b/mod/blog/start.php index a8553b4b8..eb4e11086 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -227,6 +227,34 @@ function blog_entity_menu_setup($hook, $type, $return, $params) { } /** + * Set the notification message body + * + * @param string $hook Hook name + * @param string $type Hook type + * @param string $message The current message body + * @param array $params Parameters about the blog posted + * @return string + */ +function blog_notify_message($hook, $type, $message, $params) { + $entity = $params['entity']; + $to_entity = $params['to_entity']; + $method = $params['method']; + if (elgg_instanceof($entity, 'object', 'blog')) { + $descr = $entity->description; + $title = $entity->title; + if ($method == 'email') { + $owner = $entity->getOwnerEntity(); + return $owner->name . ' ' . elgg_echo('blog:via') . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL(); + } + if ($method == 'web') { + $owner = $entity->getOwnerEntity(); + return $owner->name . ' ' . elgg_echo('blog:via') . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL(); + } + } + return null; +} + +/** * Register blogs with ECML. */ function blog_ecml_views_hook($hook, $entity_type, $return_value, $params) { |