aboutsummaryrefslogtreecommitdiff
path: root/mod/blog
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog')
-rw-r--r--mod/blog/languages/en.php10
-rw-r--r--mod/blog/start.php27
2 files changed, 37 insertions, 0 deletions
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php
index 8a21c1f8d..e1930b916 100644
--- a/mod/blog/languages/en.php
+++ b/mod/blog/languages/en.php
@@ -58,6 +58,16 @@ $english = array(
// notifications
'blog:newpost' => 'A new blog post',
+ 'blog:notification' =>
+'
+%s made a new blog post.
+
+%s
+%s
+
+View and comment on the new blog post:
+%s
+',
// widget
'blog:widget:description' => 'Display your latest blog posts',
diff --git a/mod/blog/start.php b/mod/blog/start.php
index a8553b4b8..73056f1c9 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -227,6 +227,33 @@ 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->excerpt;
+ $title = $entity->title;
+ $owner = $entity->getOwnerEntity();
+ return elgg_echo('blog:notification', array(
+ $owner->name,
+ $title,
+ $descr,
+ $entity->getURL()
+ ));
+ }
+ return null;
+}
+
+/**
* Register blogs with ECML.
*/
function blog_ecml_views_hook($hook, $entity_type, $return_value, $params) {