activate()) { $activated_guids[] = $guid; } else { register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName()))); } } // don't regenerate the simplecache because the plugin won't be // loaded until next run. Just invalidate and let it regenerate as needed elgg_invalidate_simplecache(); elgg_filepath_cache_reset(); if (count($activated_guids) === 1) { $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); }