From 5f89696ee75400f59ad895758efe046ed8fbe87f Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 28 Jun 2012 22:42:52 -0400 Subject: removed deprecate function and url from friends collections add action --- actions/friends/collections/add.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/friends/collections/add.php b/actions/friends/collections/add.php index 1e2bc1d5c..9dc17b37e 100644 --- a/actions/friends/collections/add.php +++ b/actions/friends/collections/add.php @@ -20,8 +20,7 @@ if ($id) { $result = update_access_collection($id, $friends); if ($result) { system_message(elgg_echo("friends:collectionadded")); - // go to the collections page - forward("pg/collections/" . get_loggedin_user()->username); + forward("collections/" . elgg_get_logged_in_user_entity()->username); } else { register_error(elgg_echo("friends:nocollectionname")); forward(REFERER); -- cgit v1.2.3 From 3f7f10b113e716f33221755ad44d213b61665887 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 5 Jul 2012 20:33:00 -0400 Subject: fixed plugin activate not loading page with that plugin at top --- actions/admin/plugins/activate.php | 3 ++- actions/admin/plugins/deactivate.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php index 286cf5a4f..5234a4ca5 100644 --- a/actions/admin/plugins/activate.php +++ b/actions/admin/plugins/activate.php @@ -47,7 +47,8 @@ if (count($activated_guids) === 1) { $url .= "?$query"; } $plugin = get_entity($plugin_guids[0]); - forward("$url#{$plugin->getID()}"); + $id = $css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); + forward("$url#$id"); } else { // forward to top of page with a failure so remove any #foo $url = $_SERVER['HTTP_REFERER']; diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php index e7ce65625..0a7ef9460 100644 --- a/actions/admin/plugins/deactivate.php +++ b/actions/admin/plugins/deactivate.php @@ -46,7 +46,8 @@ if (count($plugin_guids) == 1) { $url .= "?$query"; } $plugin = get_entity($plugin_guids[0]); - forward("$url#{$plugin->getID()}"); + $css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); + forward("$url#$id"); } else { forward(REFERER); } -- cgit v1.2.3 From c1c54806694e78dfac23938b24abe999cb77e61a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 5 Jul 2012 21:01:32 -0400 Subject: fixed issue with id variable from previous commit that updated plugin activate/deactivate actions --- actions/admin/plugins/deactivate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php index 0a7ef9460..354f4717d 100644 --- a/actions/admin/plugins/deactivate.php +++ b/actions/admin/plugins/deactivate.php @@ -46,7 +46,7 @@ if (count($plugin_guids) == 1) { $url .= "?$query"; } $plugin = get_entity($plugin_guids[0]); - $css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); + $id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID()); forward("$url#$id"); } else { forward(REFERER); -- cgit v1.2.3 From 2329cb233a8766ac1a6bc5d5b4d699f2ab773ea4 Mon Sep 17 00:00:00 2001 From: Sem Date: Sat, 7 Jul 2012 03:03:04 +0200 Subject: Fixes #4631. Admins are now able to delete river items. --- actions/river/delete.php | 21 +++++++++++++++++++++ engine/lib/navigation.php | 12 ++++++++++++ engine/lib/river.php | 4 +++- languages/en.php | 2 ++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 actions/river/delete.php (limited to 'actions') diff --git a/actions/river/delete.php b/actions/river/delete.php new file mode 100644 index 000000000..0d8297932 --- /dev/null +++ b/actions/river/delete.php @@ -0,0 +1,21 @@ + $id))) { + system_message(elgg_echo('river:delete:success')); + } else { + register_error(elgg_echo('river:delete:fail')); + } +} else { + register_error(elgg_echo('river:delete:fail')); +} + +forward(REFERER); diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 4ff009bfb..61d283f4b 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -335,6 +335,18 @@ function elgg_river_menu_setup($hook, $type, $return, $params) { $return[] = ElggMenuItem::factory($options); } } + + if ($object->canEdit() && elgg_is_admin_logged_in()) { + $options = array( + 'name' => 'delete', + 'href' => "action/river/delete?id=$item->id", + 'text' => elgg_view_icon('delete'), + 'title' => elgg_echo('delete'), + 'is_action' => true, + 'priority' => 200, + ); + $return[] = ElggMenuItem::factory($options); + } } return $return; diff --git a/engine/lib/river.php b/engine/lib/river.php index 711832f70..b717a7756 100644 --- a/engine/lib/river.php +++ b/engine/lib/river.php @@ -643,9 +643,11 @@ function elgg_river_init() { elgg_register_page_handler('activity', 'elgg_river_page_handler'); $item = new ElggMenuItem('activity', elgg_echo('activity'), 'activity'); elgg_register_menu_item('site', $item); - + elgg_register_widget_type('river_widget', elgg_echo('river:widget:title'), elgg_echo('river:widget:description')); + elgg_register_action('river/delete', '', 'admin'); + elgg_register_plugin_hook_handler('unit_test', 'system', 'elgg_river_test'); } diff --git a/languages/en.php b/languages/en.php index 7cd091115..7b4bc9771 100644 --- a/languages/en.php +++ b/languages/en.php @@ -437,6 +437,8 @@ $english = array( 'river:ingroup' => 'in the group %s', 'river:none' => 'No activity', 'river:update' => 'Update for %s', + 'river:delete:success' => 'River item has been deleted', + 'river:delete:fail' => 'River item could not be deleted', 'river:widget:title' => "Activity", 'river:widget:description' => "Display latest activity", -- cgit v1.2.3