diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-04 15:36:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-04 15:36:36 +0000 |
commit | f4b1ebbe468e295d59bf7285b335aa51bcf132bb (patch) | |
tree | 517ed7919069d8a6c3fb34235b048a2bbab91e98 /mod | |
parent | 559cae5d9035f65f12c1cc25cffe05880a2734c4 (diff) | |
download | elgg-f4b1ebbe468e295d59bf7285b335aa51bcf132bb.tar.gz elgg-f4b1ebbe468e295d59bf7285b335aa51bcf132bb.tar.bz2 |
Merge r6301:6338 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@6356 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/defaultwidgets/views/default/defaultwidgets/editor.php | 16 | ||||
-rw-r--r-- | mod/notifications/start.php | 28 | ||||
-rw-r--r-- | mod/profile/views/default/profile/icon.php | 4 |
3 files changed, 36 insertions, 12 deletions
diff --git a/mod/defaultwidgets/views/default/defaultwidgets/editor.php b/mod/defaultwidgets/views/default/defaultwidgets/editor.php index ef883ac01..79a641939 100644 --- a/mod/defaultwidgets/views/default/defaultwidgets/editor.php +++ b/mod/defaultwidgets/views/default/defaultwidgets/editor.php @@ -82,8 +82,8 @@ $(document).ready(function () { </h3> </td> <td width="17px" align="right"></td> -<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14px" height="14px" class="more_info" /></a></td> -<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15px" height="15px" class="drag_handle" /></a></td> +<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14" height="14" class="more_info" /></a></td> +<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15" height="15" class="drag_handle" /></a></td> </tr></table> <?php @@ -149,8 +149,8 @@ $(document).ready(function () { </h3> </td> <td width="17px" align="right"></td> - <td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14px" height="14px" class="more_info" /></a></td> - <td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15px" height="15px" class="drag_handle" /></a></td> + <td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14" height="14" class="more_info" /></a></td> + <td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15" height="15" class="drag_handle" /></a></td> </tr></table> <?php @@ -194,8 +194,8 @@ $(document).ready(function () { </h3> </td> <td width="17px" align="right"></td> -<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14px" height="14px" class="more_info" /></a></td> -<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15px" height="15px" class="drag_handle" /></a></td> +<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14" height="14" class="more_info" /></a></td> +<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15" height="15" class="drag_handle" /></a></td> </tr></table> <?php @@ -235,8 +235,8 @@ $(document).ready(function () { </h3> </td> <td width="17px" align="right"></td> -<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14px" height="14px" class="more_info" /></a></td> -<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15px" height="15px" class="drag_handle" /></a></td> +<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="14" height="14" class="more_info" /></a></td> +<td width="17px" align="right"><a href="#"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" width="15" height="15" class="drag_handle" /></a></td> </tr></table> <?php diff --git a/mod/notifications/start.php b/mod/notifications/start.php index 873095b8b..fa36d5d69 100644 --- a/mod/notifications/start.php +++ b/mod/notifications/start.php @@ -23,6 +23,10 @@ function notifications_plugin_init() { // Unset the default notification settings unregister_plugin_hook('usersettings:save', 'user', 'notification_user_settings_save'); elgg_unextend_view('usersettings/user', 'notifications/settings/usersettings'); + + // update notifications based on relationships changing + register_elgg_event_handler('delete', 'member', 'notifications_relationship_remove'); + register_elgg_event_handler('delete', 'friend', 'notifications_relationship_remove'); } /** @@ -52,7 +56,7 @@ function notifications_page_handler($page) { } /** - * Notification settings page setup function + * Notification settings sidebar menu * */ function notifications_plugin_pagesetup() { @@ -65,9 +69,29 @@ function notifications_plugin_pagesetup() { } } +/** + * Update notifications when a relationship is deleted + * + * @param string $event + * @param string $object_type + * @param object $relationship + */ +function notifications_relationship_remove($event, $object_type, $relationship) { + global $NOTIFICATION_HANDLERS; + + $user_guid = $relationship->guid_one; + $object_guid = $relationship->guid_two; + + // loop through all notification types + foreach($NOTIFICATION_HANDLERS as $method => $foo) { + remove_entity_relationship($user_guid, "notify{$method}", $object_guid); + } +} + + register_elgg_event_handler('init', 'system', 'notifications_plugin_init', 1000); -// Register action + register_action("notificationsettings/save", FALSE, $CONFIG->pluginspath . "notifications/actions/save.php"); register_action("notificationsettings/groupsave", FALSE, $CONFIG->pluginspath . "notifications/actions/groupsave.php"); diff --git a/mod/profile/views/default/profile/icon.php b/mod/profile/views/default/profile/icon.php index ef1b32b36..bca4499fc 100644 --- a/mod/profile/views/default/profile/icon.php +++ b/mod/profile/views/default/profile/icon.php @@ -50,7 +50,7 @@ if ($vars['entity'] instanceof ElggUser) { if (!$override) { ?> <div class="usericon <?php echo $vars['size']; ?>"> - <div class="avatar_menu_button"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" border="0" width="15px" height="15px" /></div> + <div class="avatar_menu_button"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" border="0" width="15" height="15" /></div> <div class="sub_menu"> <h3 class="displayname"><a href="<?php echo $vars['entity']->getURL(); ?>"><?php echo $vars['entity']->name; ?> <span class="username"><?php echo "@" . $vars['entity']->username; ?></span></a></h3> @@ -104,7 +104,7 @@ if ($vars['entity'] instanceof ElggUser) { <?php /* original avatar method - <img src="<?php echo $vars['entity']->getIcon($vars['size']); ?>" border="0" <?php echo $align; ?> alt="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" title="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $vars['js']; ?> /> + <img src="<?php echo elgg_format_url($vars['entity']->getIcon($vars['size'])); ?>" border="0" <?php echo $align; ?> alt="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" title="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $vars['js']; ?> /> */ if (!$override) { |