aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-06-18 19:56:33 -0400
committerBrett Profitt <brett.profitt@gmail.com>2011-06-18 19:56:33 -0400
commitec7b94a64aef23b85866ecdac8e8acc712d29bb6 (patch)
treea108205c3fa0b694d8ce0ebaafd259480d6b530a /actions
parentc80ba5aa03264dd64c20ed8ae222e87f9371a44d (diff)
parent2b68a4d217c35a5587c462620789493cf2804ba2 (diff)
downloadelgg-ec7b94a64aef23b85866ecdac8e8acc712d29bb6.tar.gz
elgg-ec7b94a64aef23b85866ecdac8e8acc712d29bb6.tar.bz2
Merge branch 'master' of github.com:Elgg/Elgg
Diffstat (limited to 'actions')
-rw-r--r--actions/admin/plugins/activate.php9
-rw-r--r--actions/admin/plugins/activate_all.php20
-rw-r--r--actions/admin/plugins/deactivate.php11
-rw-r--r--actions/admin/plugins/deactivate_all.php20
-rw-r--r--actions/admin/plugins/set_priority.php4
-rw-r--r--actions/admin/plugins/simple_update_states.php2
-rw-r--r--actions/avatar/crop.php3
-rw-r--r--actions/avatar/upload.php4
-rw-r--r--actions/logout.php1
-rw-r--r--actions/plugins/settings/save.php2
-rw-r--r--actions/plugins/usersettings/save.php2
11 files changed, 52 insertions, 26 deletions
diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php
index 0d930b27f..feb986b27 100644
--- a/actions/admin/plugins/activate.php
+++ b/actions/admin/plugins/activate.php
@@ -29,7 +29,7 @@ foreach ($plugin_guids as $guid) {
if ($plugin->activate()) {
$activated_guids[] = $guid;
} else {
- register_error(elgg_echo('admin:plugins:activate:no', array($plugin->manifest->getName())));
+ register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName())));
}
}
@@ -39,7 +39,12 @@ elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
if (count($activated_guids) === 1) {
- forward("admin/plugins/advanced#elgg-plugin-" . $plugin_guids[0]);
+ $url = 'admin/plugins';
+ $query = (string)parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
+ if ($query) {
+ $url .= "?$query";
+ }
+ forward($url . '#elgg-plugin-' . $plugin_guids[0]);
} else {
forward(REFERER);
} \ No newline at end of file
diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php
index 25802ce2e..19eb82142 100644
--- a/actions/admin/plugins/activate_all.php
+++ b/actions/admin/plugins/activate_all.php
@@ -1,21 +1,25 @@
<?php
/**
- * Activates all installed and inactive plugins.
+ * Activates all specified installed and inactive plugins.
*
- * All plugins in the mod/ directory are that aren't active are activated and the views
+ * All specified plugins in the mod/ directory are that aren't active are activated and the views
* cache and simplecache are invalidated.
*
* @package Elgg.Core
* @subpackage Administration.Plugins
*/
-$plugins = elgg_get_plugins('inactive');
+$guids = get_input('guids');
+$guids = explode(',', $guids);
-foreach ($plugins as $plugin) {
- if ($plugin->activate()) {
- //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->manifest->getName())));
- } else {
- register_error(elgg_echo('admin:plugins:activate:no', array($plugin->manifest->getName())));
+foreach ($guids as $guid) {
+ $plugin = get_entity($guid);
+ if (!$plugin->isActive()) {
+ if ($plugin->activate()) {
+ //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName())));
+ } else {
+ register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName())));
+ }
}
}
diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php
index 74c78e0fc..6c9a55c15 100644
--- a/actions/admin/plugins/deactivate.php
+++ b/actions/admin/plugins/deactivate.php
@@ -26,9 +26,9 @@ foreach ($plugin_guids as $guid) {
}
if ($plugin->deactivate()) {
- //system_message(elgg_echo('admin:plugins:deactivate:yes', array($plugin->manifest->getName())));
+ //system_message(elgg_echo('admin:plugins:deactivate:yes', array($plugin->getManifest()->getName())));
} else {
- register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->manifest->getName())));
+ register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->getName())));
}
}
@@ -38,7 +38,12 @@ elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
if (count($plugin_guids) == 1) {
- forward("admin/plugins/advanced#elgg-plugin-" . $plugin_guids[0]);
+ $url = 'admin/plugins';
+ $query = (string)parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
+ if ($query) {
+ $url .= "?$query";
+ }
+ forward($url . '#elgg-plugin-' . $plugin_guids[0]);
} else {
forward(REFERER);
}
diff --git a/actions/admin/plugins/deactivate_all.php b/actions/admin/plugins/deactivate_all.php
index f1bea0a2c..436a3ad30 100644
--- a/actions/admin/plugins/deactivate_all.php
+++ b/actions/admin/plugins/deactivate_all.php
@@ -1,21 +1,25 @@
<?php
/**
- * Disable all installed plugins.
+ * Disable all specified installed plugins.
*
- * All plugins in the mod/ directory are disabled and the views cache and simplecache
+ * Specified plugins in the mod/ directory are disabled and the views cache and simplecache
* are reset.
*
* @package Elgg.Core
* @subpackage Administration.Plugins
*/
-$plugins = elgg_get_plugins('active');
+$guids = get_input('guids');
+$guids = explode(',', $guids);
-foreach ($plugins as $plugin) {
- if ($plugin->deactivate()) {
- //system_message(elgg_echo('admin:plugins:deactivate:yes', array($plugin->manifest->getName())));
- } else {
- register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->manifest->getName())));
+foreach ($guids as $guid) {
+ $plugin = get_entity($guid);
+ if ($plugin->isActive()) {
+ if ($plugin->deactivate()) {
+ //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName())));
+ } else {
+ register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->getName())));
+ }
}
}
diff --git a/actions/admin/plugins/set_priority.php b/actions/admin/plugins/set_priority.php
index fd7857e49..702aae91b 100644
--- a/actions/admin/plugins/set_priority.php
+++ b/actions/admin/plugins/set_priority.php
@@ -25,9 +25,9 @@ if (!($plugin instanceof ElggPlugin)) {
}
if ($plugin->setPriority($priority)) {
- //system_message(elgg_echo('admin:plugins:set_priority:yes', array($plugin->manifest->getName())));
+ //system_message(elgg_echo('admin:plugins:set_priority:yes', array($plugin->getManifest()->getName())));
} else {
- register_error(elgg_echo('admin:plugins:set_priority:no', array($plugin->manifest->getName())));
+ register_error(elgg_echo('admin:plugins:set_priority:no', array($plugin->getManifest()->getName())));
}
// don't regenerate the simplecache because the plugin won't be
diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php
index 662a5c3dd..7601013a7 100644
--- a/actions/admin/plugins/simple_update_states.php
+++ b/actions/admin/plugins/simple_update_states.php
@@ -22,7 +22,7 @@ $success = TRUE;
foreach ($installed_plugins as $plugin) {
// this is only for simple plugins.
- if ($plugin->manifest->getAdminInterface() != 'simple') {
+ if ($plugin->getManifest()->getAdminInterface() != 'simple') {
continue;
}
diff --git a/actions/avatar/crop.php b/actions/avatar/crop.php
index ed5faecfa..9c57530ae 100644
--- a/actions/avatar/crop.php
+++ b/actions/avatar/crop.php
@@ -65,5 +65,8 @@ $owner->y1 = $y1;
$owner->y2 = $y2;
system_message(elgg_echo('avatar:crop:success'));
+$view = 'river/user/default/profileiconupdate';
+elgg_delete_river(array('subject_guid' => $owner->guid, 'view' => $view));
+add_to_river($view, 'update', $owner->guid, $owner->guid);
forward(REFERER);
diff --git a/actions/avatar/upload.php b/actions/avatar/upload.php
index 052212e97..e21aa49c8 100644
--- a/actions/avatar/upload.php
+++ b/actions/avatar/upload.php
@@ -50,6 +50,10 @@ foreach ($icon_sizes as $name => $size_info) {
$owner->icontime = time();
if (elgg_trigger_event('profileiconupdate', $owner->type, $owner)) {
system_message(elgg_echo("avatar:upload:success"));
+
+ $view = 'river/user/default/profileiconupdate';
+ elgg_delete_river(array('subject_guid' => $owner->guid, 'view' => $view));
+ add_to_river($view, 'update', $owner->guid, $owner->guid);
}
forward(REFERER);
diff --git a/actions/logout.php b/actions/logout.php
index 98926d205..c48a26b15 100644
--- a/actions/logout.php
+++ b/actions/logout.php
@@ -12,6 +12,7 @@ $result = logout();
// Set the system_message as appropriate
if ($result) {
system_message(elgg_echo('logoutok'));
+ forward();
} else {
register_error(elgg_echo('logouterror'));
} \ No newline at end of file
diff --git a/actions/plugins/settings/save.php b/actions/plugins/settings/save.php
index f3c865b9f..3b5694039 100644
--- a/actions/plugins/settings/save.php
+++ b/actions/plugins/settings/save.php
@@ -21,7 +21,7 @@ if (!($plugin instanceof ElggPlugin)) {
forward(REFERER);
}
-$plugin_name = $plugin->manifest->getName();
+$plugin_name = $plugin->getManifest()->getName();
$result = false;
diff --git a/actions/plugins/usersettings/save.php b/actions/plugins/usersettings/save.php
index 9c1657388..c6214f68d 100644
--- a/actions/plugins/usersettings/save.php
+++ b/actions/plugins/usersettings/save.php
@@ -29,7 +29,7 @@ if (!($user instanceof ElggUser)) {
forward(REFERER);
}
-$plugin_name = $plugin->manifest->getName();
+$plugin_name = $plugin->getManifest()->getName();
// make sure we're admin or the user
if (!$user->canEdit()) {