]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4335. Cleaned up the notifications for new content.
authorBrett Profitt <brett.profitt@gmail.com>
Wed, 22 Feb 2012 06:53:22 +0000 (22:53 -0800)
committerBrett Profitt <brett.profitt@gmail.com>
Wed, 22 Feb 2012 06:53:22 +0000 (22:53 -0800)
mod/blog/languages/en.php
mod/blog/start.php
mod/bookmarks/languages/en.php
mod/bookmarks/start.php
mod/file/languages/en.php
mod/file/start.php
mod/pages/languages/en.php
mod/pages/start.php

index 42606bf8efd6b51e59d79384eca351b426a7e7b5..e1930b9165eb54837120f0d46af78710d2b3b427 100644 (file)
@@ -58,7 +58,16 @@ $english = array(
 
        // notifications
        'blog:newpost' => 'A new blog post',
-       'blog:via' => "published a 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',
index eb4e1108676c953276c0e0dc2eae541c7b373599..73056f1c9c660efbb61fbdd6625acf8ce09a45e7 100644 (file)
@@ -240,16 +240,15 @@ function blog_notify_message($hook, $type, $message, $params) {
        $to_entity = $params['to_entity'];
        $method = $params['method'];
        if (elgg_instanceof($entity, 'object', 'blog')) {
-               $descr = $entity->description;
+               $descr = $entity->excerpt;
                $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();
-               }
+               $owner = $entity->getOwnerEntity();
+               return elgg_echo('blog:notification', array(
+                       $owner->name,
+                       $title,
+                       $descr,
+                       $entity->getURL()
+               ));
        }
        return null;
 }
index 2c589c2075be3c7bc64ca42ad33887fa9dfef129..d4980280d6d0caf0d7091bb47f5f6ebd4fef6798 100644 (file)
@@ -23,10 +23,19 @@ $english = array(
        'bookmarks:more' => "More",
        'bookmarks:with' => "Share with",
        'bookmarks:new' => "A new bookmark",
-       'bookmarks:via' => "via bookmarks",
        'bookmarks:address' => "Address of the bookmark",
        'bookmarks:none' => 'No bookmarks',
 
+       'bookmarks:notification' =>
+'%s added a new bookmark:
+
+%s - %s
+%s
+
+View and comment on the new bookmark:
+%s
+',
+
        'bookmarks:delete:confirm' => "Are you sure you want to delete this resource?",
 
        'bookmarks:numbertodisplay' => 'Number of bookmarks to display',
index 21a2d8940fb4204a641c1e9467e049596d726c06..56bac984a9967db8e23996e4a8a5729823d0db5e 100644 (file)
@@ -245,21 +245,15 @@ function bookmarks_notify_message($hook, $entity_type, $returnvalue, $params) {
        if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'bookmarks')) {
                $descr = $entity->description;
                $title = $entity->title;
-               global $CONFIG;
-               $url = elgg_get_site_url() . "view/" . $entity->guid;
-               if ($method == 'sms') {
-                       $owner = $entity->getOwnerEntity();
-                       return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $url . ' (' . $title . ')';
-               }
-               if ($method == 'email') {
-                       $owner = $entity->getOwnerEntity();
-                       return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL();
-               }
-               if ($method == 'web') {
-                       $owner = $entity->getOwnerEntity();
-                       return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL();
-               }
-
+               $owner = $entity->getOwnerEntity();
+
+               return elgg_echo('bookmarks:notification', array(
+                       $owner->name,
+                       $title,
+                       $entity->address,
+                       $descr,
+                       $entity->getURL()
+               ));
        }
        return null;
 }
index 2780769275a085942d1222de7212252e4b1c1fbd..b3344cb43e0ca240b682a52e568fb1149c2ed6ba 100644 (file)
@@ -22,7 +22,6 @@ $english = array(
        'file:gallery_list' => "Gallery or list view",
        'file:num_files' => "Number of files to display",
        'file:user:gallery'=>'View %s gallery',
-       'file:via' => 'via files',
        'file:upload' => "Upload a file",
        'file:replace' => 'Replace file content (leave blank to not change file)',
        'file:list:title' => "%s's %s %s",
@@ -79,6 +78,15 @@ $english = array(
        'item:object:file' => 'Files',
 
        'file:newupload' => 'A new file has been uploaded',
+       'file:notification' =>
+'%s uploaded a new file:
+
+%s
+%s
+
+View and comment on the new file:
+%s
+',
 
        /**
         * Embed media
index f8b51231881ba48790506c99d64773ba15c9a9d1..1201292762ed0eb7364b9812cd1605c04abe67c4 100644 (file)
@@ -200,9 +200,13 @@ function file_notify_message($hook, $entity_type, $returnvalue, $params) {
        if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'file')) {
                $descr = $entity->description;
                $title = $entity->title;
-               $url = elgg_get_site_url() . "view/" . $entity->guid;
                $owner = $entity->getOwnerEntity();
-               return $owner->name . ' ' . elgg_echo("file:via") . ': ' . $entity->title . "\n\n" . $descr . "\n\n" . $entity->getURL();
+               return elgg_echo('file:notification', array(
+                       $owner->name,
+                       $title,
+                       $descr,
+                       $entity->getURL()
+               ));
        }
        return null;
 }
index 3620e7e8e3207e9c81b09832b9e63c719255c396..eb9d22708c3f1eb80ab115fb4f9f966c48ec4e76 100644 (file)
@@ -28,7 +28,15 @@ $english = array(
 
        'pages:navigation' => "Navigation",
        'pages:new' => "A new page",
-       'pages:via' => "via pages",
+       'pages:notification' =>
+'%s added a new page:
+
+%s
+%s
+
+View and comment on the new page:
+%s
+',
        'item:object:page_top' => 'Top-level pages',
        'item:object:page' => 'Pages',
        'pages:nogroup' => 'This group does not have any pages yet',
index b2f26c719b47e60f8012963dbed8cf02eeb5d7d7..4b230a93d3b3dc09194159ac3b735525d58df94b 100644 (file)
@@ -264,13 +264,18 @@ function page_notify_message($hook, $entity_type, $returnvalue, $params) {
        $entity = $params['entity'];
        $to_entity = $params['to_entity'];
        $method = $params['method'];
-       if (($entity instanceof ElggEntity) && (($entity->getSubtype() == 'page_top') || ($entity->getSubtype() == 'page'))) {
+
+       if (elgg_instanceof($entity, 'object', 'page') || elgg_instanceof($entity, 'object', 'page_top')) {
                $descr = $entity->description;
                $title = $entity->title;
-               //@todo why?
-               $url = elgg_get_site_url() . "view/" . $entity->guid;
                $owner = $entity->getOwnerEntity();
-               return $owner->name . ' ' . elgg_echo("pages:via") . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL();
+               
+               return elgg_echo('pages:notification', array(
+                       $owner->name,
+                       $title,
+                       $descr,
+                       $entity->getURL()
+               ));
        }
        return null;
 }