This is one of the advantages of Elgg. To extend a view, it is not necessary that the view exists really.
If your need is to remove some group modules, then use the remove_group_tool_option() API.
Thanks for your answer, but this function doesn't delete the group module views, but group options.
I make this (I have not found another way to do this :D):
<?php
function remove_all_group_modules($modules_mantener) {
global $CONFIG;
$modules_hay = $CONFIG->group_tool_options;
if (!isset($modules_hay) || ($modules_hay == NULL)) {
return;
}
foreach($modules_hay as $entity){
elgg_unextend_view('groups/tool_latest', "$entity->name/group_module");
if ($entity->name == "forum"){
elgg_unextend_view('groups/tool_latest', "discussion/group_module");
}
if ($entity->name == "activity"){
elgg_unextend_view('groups/tool_latest', "groups/profile/activity_module");
}
if ($entity->name == "subgroups"){
elgg_unextend_view('groups/tool_latest', "au_subgroups/group_module");
}
}}
foreach($modules_mantener as $module){
elgg_extend_view('groups/tool_latest', "$module/group_module");
}
And in start.php
//TODO: que los recoja de las settings del theme.
$modules = array("bookmarks","blog");//se los pasamos a una función que elimina todos menos estos
remove_all_group_modules($modules);
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.