aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/languages/en.php11
-rw-r--r--mod/blog/start.php17
-rw-r--r--mod/bookmarks/languages/en.php11
-rw-r--r--mod/bookmarks/start.php24
-rw-r--r--mod/file/languages/en.php10
-rw-r--r--mod/file/start.php8
-rw-r--r--mod/groups/languages/en.php10
-rw-r--r--mod/groups/start.php54
-rw-r--r--mod/likes/views/default/likes/button.php5
-rw-r--r--mod/pages/languages/en.php10
-rw-r--r--mod/pages/start.php17
-rw-r--r--mod/search/pages/search/index.php6
-rw-r--r--mod/search/search_hooks.php2
-rw-r--r--mod/search/start.php7
-rw-r--r--mod/thewire/pages/thewire/owner.php4
-rw-r--r--mod/thewire/start.php2
-rw-r--r--mod/twitter_api/actions/twitter_api/interstitial_settings.php4
17 files changed, 114 insertions, 88 deletions
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php
index 42606bf8e..e1930b916 100644
--- a/mod/blog/languages/en.php
+++ b/mod/blog/languages/en.php
@@ -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',
diff --git a/mod/blog/start.php b/mod/blog/start.php
index eb4e11086..73056f1c9 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -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;
}
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php
index 2c589c207..d4980280d 100644
--- a/mod/bookmarks/languages/en.php
+++ b/mod/bookmarks/languages/en.php
@@ -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',
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index 21a2d8940..56bac984a 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -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;
}
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index 278076927..b3344cb43 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -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
diff --git a/mod/file/start.php b/mod/file/start.php
index f8b512318..120129276 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -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;
}
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index a4a9e2b2b..e51e51a14 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -64,6 +64,16 @@ $english = array(
'groups:search_in_group' => "Search in this group",
'groups:acl' => "Group: %s",
+ 'groups:notification' =>
+'%s added a new discussion topic to %s:
+
+%s
+%s
+
+View and reply to the discussion:
+%s
+',
+
'groups:activity' => "Group activity",
'groups:enableactivity' => 'Enable group activity',
'groups:activity:none' => "There is no group activity yet",
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 86a1da279..aeab0649a 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -741,7 +741,6 @@ function discussion_init() {
// notifications
register_notification_object('object', 'groupforumtopic', elgg_echo('groupforumtopic:new'));
- elgg_register_plugin_hook_handler('object:notifications', 'object', 'group_object_notifications_intercept');
elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'groupforumtopic_notify_message');
}
@@ -855,41 +854,19 @@ function discussion_add_to_river_menu($hook, $type, $return, $params) {
function group_object_notifications($event, $object_type, $object) {
static $flag;
- if (!isset($flag))
+ if (!isset($flag)) {
$flag = 0;
+ }
if (is_callable('object_notifications'))
if ($object instanceof ElggObject) {
if ($object->getSubtype() == 'groupforumtopic') {
- //if ($object->countAnnotations('group_topic_post') > 0) {
if ($flag == 0) {
$flag = 1;
object_notifications($event, $object_type, $object);
}
- //}
- }
- }
-}
-
-/**
- * Intercepts the notification on group topic creation and prevents a notification from going out
- * (because one will be sent on the annotation)
- *
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $returnvalue
- * @param unknown_type $params
- * @return unknown
- */
-function group_object_notifications_intercept($hook, $entity_type, $returnvalue, $params) {
- if (isset($params)) {
- if ($params['event'] == 'create' && $params['object'] instanceof ElggObject) {
- if ($params['object']->getSubtype() == 'groupforumtopic') {
- return true;
}
}
- }
- return null;
}
/**
@@ -904,26 +881,23 @@ function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $para
$entity = $params['entity'];
$to_entity = $params['to_entity'];
$method = $params['method'];
- if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'groupforumtopic')) {
+ if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'groupforumtopic')) {
$descr = $entity->description;
$title = $entity->title;
$url = $entity->getURL();
-
- $msg = get_input('topicmessage');
- if (empty($msg))
- $msg = get_input('topic_post');
- if (!empty($msg))
- $msg = $msg . "\n\n"; else
- $msg = '';
-
- $owner = get_entity($entity->container_guid);
- if ($method == 'sms') {
- return elgg_echo("groupforumtopic:new") . ': ' . $url . " ({$owner->name}: {$title})";
- } else {
- return elgg_get_logged_in_user_entity()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL();
- }
+ $owner = $entity->getOwnerEntity();
+ $group = $entity->getContainerEntity();
+
+ return elgg_echo('groups:notification', array(
+ $owner->name,
+ $group->name,
+ $entity->title,
+ $entity->description,
+ $entity->getURL()
+ ));
}
+
return null;
}
diff --git a/mod/likes/views/default/likes/button.php b/mod/likes/views/default/likes/button.php
index 3f2f073cc..bc7c8fd8a 100644
--- a/mod/likes/views/default/likes/button.php
+++ b/mod/likes/views/default/likes/button.php
@@ -24,11 +24,6 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) {
);
$likes_button = elgg_view('output/url', $params);
} else {
- $options = array(
- 'guid' => $guid,
- 'annotation_name' => 'likes',
- 'owner_guid' => elgg_get_logged_in_user_guid()
- );
$url = elgg_get_site_url() . "action/likes/delete?guid={$guid}";
$params = array(
'href' => $url,
diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php
index 3620e7e8e..eb9d22708 100644
--- a/mod/pages/languages/en.php
+++ b/mod/pages/languages/en.php
@@ -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',
diff --git a/mod/pages/start.php b/mod/pages/start.php
index b2f26c719..834e98870 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -189,10 +189,12 @@ function pages_icon_url_override($hook, $type, $returnvalue, $params) {
if (elgg_instanceof($entity, 'object', 'page_top') ||
elgg_instanceof($entity, 'object', 'page')) {
switch ($params['size']) {
+ case 'topbar':
+ case 'tiny':
case 'small':
return 'mod/pages/images/pages.gif';
break;
- case 'medium':
+ default:
return 'mod/pages/images/pages_lrg.gif';
break;
}
@@ -264,13 +266,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;
}
diff --git a/mod/search/pages/search/index.php b/mod/search/pages/search/index.php
index 91817096b..fcd95c43e 100644
--- a/mod/search/pages/search/index.php
+++ b/mod/search/pages/search/index.php
@@ -257,7 +257,11 @@ if ($search_type != 'entities' || $search_type == 'all') {
}
// highlight search terms
-$searched_words = search_remove_ignored_words($display_query, 'array');
+if ($search_type == 'tags') {
+ $searched_words = array($display_query);
+} else {
+ $searched_words = search_remove_ignored_words($display_query, 'array');
+}
$highlighted_query = search_highlight_words($searched_words, $display_query);
$body = elgg_view_title(elgg_echo('search:results', array("\"$highlighted_query\"")));
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php
index ab000f6f6..2143a0d24 100644
--- a/mod/search/search_hooks.php
+++ b/mod/search/search_hooks.php
@@ -284,7 +284,7 @@ function search_tags_hook($hook, $type, $value, $params) {
}
$tags_str = implode('. ', $matched_tags_strs);
- $tags_str = search_get_highlighted_relevant_substrings($tags_str, $params['query']);
+ $tags_str = search_get_highlighted_relevant_substrings($tags_str, $params['query'], 30, 300, true);
$entity->setVolatileData('search_matched_title', $title_str);
$entity->setVolatileData('search_matched_description', $desc_str);
diff --git a/mod/search/start.php b/mod/search/start.php
index bb8531e9c..d2d7ed3c2 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -83,15 +83,18 @@ function search_page_handler($page) {
* @param string $query
* @param int $min_match_context = 30
* @param int $max_length = 300
+ * @param bool $tag_match Search is for tags. Don't ignore words.
* @return string
*/
-function search_get_highlighted_relevant_substrings($haystack, $query, $min_match_context = 30, $max_length = 300) {
+function search_get_highlighted_relevant_substrings($haystack, $query, $min_match_context = 30, $max_length = 300, $tag_match = false) {
$haystack = strip_tags($haystack);
$haystack_length = elgg_strlen($haystack);
$haystack_lc = elgg_strtolower($haystack);
- $words = search_remove_ignored_words($query, 'array');
+ if (!$tag_match) {
+ $words = search_remove_ignored_words($query, 'array');
+ }
// if haystack < $max_length return the entire haystack w/formatting immediately
if ($haystack_length <= $max_length) {
diff --git a/mod/thewire/pages/thewire/owner.php b/mod/thewire/pages/thewire/owner.php
index f544aa655..6246c1770 100644
--- a/mod/thewire/pages/thewire/owner.php
+++ b/mod/thewire/pages/thewire/owner.php
@@ -14,10 +14,12 @@ $title = elgg_echo('thewire:user', array($owner->name));
elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name);
+$context = '';
if (elgg_get_logged_in_user_guid() == $owner->guid) {
$form_vars = array('class' => 'thewire-form');
$content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
+ $context = 'mine';
}
$content .= elgg_list_entities(array(
@@ -28,7 +30,7 @@ $content .= elgg_list_entities(array(
));
$body = elgg_view_layout('content', array(
- 'filter_context' => 'mine',
+ 'filter_context' => $context,
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('thewire/sidebar'),
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index ebfe29538..5d5786e2f 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -304,7 +304,7 @@ function thewire_save_post($text, $userid, $access_id, $parent_guid = 0, $method
*/
function thewire_send_response_notification($guid, $parent_guid, $user) {
$parent_owner = get_entity($parent_guid)->getOwnerEntity();
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
// check to make sure user is not responding to self
if ($parent_owner->guid != $user->guid) {
diff --git a/mod/twitter_api/actions/twitter_api/interstitial_settings.php b/mod/twitter_api/actions/twitter_api/interstitial_settings.php
index 5f742efd8..880623973 100644
--- a/mod/twitter_api/actions/twitter_api/interstitial_settings.php
+++ b/mod/twitter_api/actions/twitter_api/interstitial_settings.php
@@ -6,8 +6,8 @@ elgg_make_sticky_form('twitter_api_interstitial');
$display_name = get_input('display_name');
$email = get_input('email');
-$password_1 = get_input('password_1');
-$password_2 = get_input('password_2');
+$password_1 = get_input('password_1', null, false);
+$password_2 = get_input('password_2', null, false);
if (!$display_name) {
register_error(elgg_echo('twitter_api:interstitial:no_display_name'));