aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/admin/plugins/activate.php3
-rw-r--r--actions/admin/plugins/deactivate.php3
-rw-r--r--actions/friends/collections/add.php3
-rw-r--r--actions/river/delete.php21
4 files changed, 26 insertions, 4 deletions
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..354f4717d 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()}");
+ $id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID());
+ forward("$url#$id");
} else {
forward(REFERER);
}
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);
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 @@
+<?php
+/**
+ * River item delete action
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$id = get_input('id', false);
+
+if ($id !== false && elgg_is_admin_logged_in()) {
+ if (elgg_delete_river(array('id' => $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);