From 82593cd2bc056da73caa1b1e981c5a9ead0f1bf2 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 27 Apr 2011 02:37:16 +0000 Subject: Refs #3362. Plugins don't check deps upon boot. Made package and manifest private properties of ElggPlugin and added ->getPackage() and ->getManifest(). git-svn-id: http://code.elgg.org/elgg/trunk@9030 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/plugins/activate.php | 2 +- actions/admin/plugins/activate_all.php | 4 ++-- actions/admin/plugins/deactivate.php | 4 ++-- actions/admin/plugins/deactivate_all.php | 4 ++-- actions/admin/plugins/set_priority.php | 4 ++-- actions/admin/plugins/simple_update_states.php | 2 +- actions/plugins/settings/save.php | 2 +- actions/plugins/usersettings/save.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) (limited to 'actions') diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php index 0d930b27f..e04ee6298 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()))); } } diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php index 25802ce2e..0f0352877 100644 --- a/actions/admin/plugins/activate_all.php +++ b/actions/admin/plugins/activate_all.php @@ -13,9 +13,9 @@ $plugins = elgg_get_plugins('inactive'); foreach ($plugins as $plugin) { if ($plugin->activate()) { - //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->manifest->getName()))); + //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName()))); } 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()))); } } diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php index 74c78e0fc..9ec620e13 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()))); } } diff --git a/actions/admin/plugins/deactivate_all.php b/actions/admin/plugins/deactivate_all.php index f1bea0a2c..446cad8c0 100644 --- a/actions/admin/plugins/deactivate_all.php +++ b/actions/admin/plugins/deactivate_all.php @@ -13,9 +13,9 @@ $plugins = elgg_get_plugins('active'); foreach ($plugins as $plugin) { 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()))); } } 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/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()) { -- cgit v1.2.3 From 5f673099212b1377ab34471a041ed2f2e169d711 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 14 May 2011 21:58:17 +0000 Subject: on logout send the user to the main page git-svn-id: http://code.elgg.org/elgg/trunk@9085 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/logout.php | 1 + 1 file changed, 1 insertion(+) (limited to 'actions') 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 -- cgit v1.2.3 From 64045426f4eb5150c46dd2534058c3522bbe6ecf Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 9 Jun 2011 20:19:08 +0000 Subject: Fixes #2871 activate all/deactivate all now sensitive to filtering git-svn-id: http://code.elgg.org/elgg/trunk@9158 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/plugins/activate_all.php | 20 ++++++---- actions/admin/plugins/deactivate_all.php | 20 ++++++---- views/default/admin/plugins.php | 44 ++++++++++++---------- views/default/css/admin.php | 7 ++++ views/default/forms/admin/plugins/change_state.php | 20 ++++++++++ 5 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 views/default/forms/admin/plugins/change_state.php (limited to 'actions') diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php index 0f0352877..19eb82142 100644 --- a/actions/admin/plugins/activate_all.php +++ b/actions/admin/plugins/activate_all.php @@ -1,21 +1,25 @@ 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()))); +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_all.php b/actions/admin/plugins/deactivate_all.php index 446cad8c0..436a3ad30 100644 --- a/actions/admin/plugins/deactivate_all.php +++ b/actions/admin/plugins/deactivate_all.php @@ -1,21 +1,25 @@ deactivate()) { - //system_message(elgg_echo('admin:plugins:deactivate:yes', array($plugin->getManifest()->getName()))); - } else { - register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->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/views/default/admin/plugins.php b/views/default/admin/plugins.php index 9f426fae2..1aa899fcc 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -1,8 +1,8 @@ $plugin) { } } +$guids = array(); +foreach ($installed_plugins as $plugin) { + $guids[] = $plugin->getGUID(); +} + // sort plugins switch ($sort) { case 'date': @@ -99,7 +104,7 @@ if (!array_key_exists($show_category, $categories)) { } $category_form = elgg_view_form('admin/plugins/filter', array( - 'action' => 'admin/plugins/advanced', + 'action' => 'admin/plugins', 'method' => 'get', 'disable_security' => true, ), array( @@ -120,7 +125,7 @@ if (!array_key_exists($sort, $sort_options)) { } $sort_form = elgg_view_form('admin/plugins/sort', array( - 'action' => 'admin/plugins/advanced', + 'action' => 'admin/plugins', 'method' => 'get', 'disable_security' => true, ), array( @@ -129,21 +134,22 @@ $sort_form = elgg_view_form('admin/plugins/sort', array( 'category' => $show_category, )); - -// @todo Until "en/deactivate all" means "All plugins on this page" hide when not looking at all. -if ($show_category == 'all') { - $activate_url = "action/admin/plugins/activate_all"; - $activate_url = elgg_add_action_tokens_to_url($activate_url); - $deactivate_url = "action/admin/plugins/deactivate_all"; - $deactivate_url = elgg_add_action_tokens_to_url($deactivate_url); - - $buttons = ""; -} else { - $buttons = ''; -} +$buttons = "
"; +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/activate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'activate', +)); +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/deactivate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'deactivate', +)); +$buttons .= "
"; $buttons .= $category_form . $sort_form; diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 744211a20..e04bdc568 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -158,6 +158,13 @@ table.mceLayout { .center { text-align: center; } +.float { + float: left; +} +.float-alt { + float: right; +} + /* *************************************** PAGE WRAPPER *************************************** */ diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php new file mode 100644 index 000000000..ba5d873e7 --- /dev/null +++ b/views/default/forms/admin/plugins/change_state.php @@ -0,0 +1,20 @@ + 'guids', + 'value' => $guids, +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), + 'class' => 'elgg-button elgg-button-action' +)); -- cgit v1.2.3 From ce395de063d23c691d47204b351f50f5a1958b58 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 9 Jun 2011 21:05:34 +0000 Subject: Refs #2871 Forgot to update the forwarding for activate/deactivate actions git-svn-id: http://code.elgg.org/elgg/trunk@9161 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/plugins/activate.php | 7 ++++++- actions/admin/plugins/deactivate.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php index e04ee6298..feb986b27 100644 --- a/actions/admin/plugins/activate.php +++ b/actions/admin/plugins/activate.php @@ -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/deactivate.php b/actions/admin/plugins/deactivate.php index 9ec620e13..6c9a55c15 100644 --- a/actions/admin/plugins/deactivate.php +++ b/actions/admin/plugins/deactivate.php @@ -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); } -- cgit v1.2.3 From 4f984fc470900df2a2c18dff02895ea2f230e099 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 11 Jun 2011 19:14:25 +0000 Subject: added user avatar river messages back git-svn-id: http://code.elgg.org/elgg/trunk@9181 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/avatar/crop.php | 3 +++ actions/avatar/upload.php | 4 ++++ languages/en.php | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'actions') 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/languages/en.php b/languages/en.php index a34f3e1f5..d3e6de26f 100644 --- a/languages/en.php +++ b/languages/en.php @@ -344,8 +344,6 @@ $english = array( 'friends:collections:members' => "Collection members", 'friends:collections:edit' => "Edit collection", - 'friends:river:add' => "is now a friend with %s", - 'friendspicker:chararray' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'avatar' => 'Avatar', @@ -406,6 +404,8 @@ $english = array( */ 'river' => "River", 'river:relationship:friend' => 'is now friends with', + 'friends:river:add' => "is now a friend with %s", + 'profile:river:iconupdate' => 'updated their profile icon', 'river:noaccess' => 'You do not have permission to view this item.', 'river:posted:generic' => '%s posted', 'riveritem:single:user' => 'a user', -- cgit v1.2.3