but not for Friends
Then override _elgg_friends_page_setup:
elgg_unregister_event_handler('pagesetup', 'system', '_elgg_friends_page_setup');
elgg_register_event_handler('pagesetup', 'system', 'my_friends_page_setup');
function my_friends_page_setup() {
$owner = elgg_get_page_owner_entity();
$viewer = elgg_get_logged_in_user_entity();
if ($owner) {
$params = array(
'name' => 'friends',
'text' => elgg_echo('friends'),
'href' => 'friends/' . $owner->username,
'contexts' => array('friends')
);
elgg_register_menu_item('page', $params);
$params = array(
'name' => 'friends:of',
'text' => elgg_echo('friends:of'),
'href' => 'friendsof/' . $owner->username,
'contexts' => array('friends')
);
elgg_register_menu_item('page', $params);
}
}Yeah thanks that works fine.
I've just found this method too:
$item = elgg_get_menu_item('topbar', 'messages');
if ($item) {
$item->setText(elgg_echo('dashboard'));
$item->setPriority(200);
$item->setSection('default');
}
So I can manipulate the menu item without breaking the standard mecanism.
But seem to doesn't work with all,
There is a menu hook intended just for this:
// register with higher priority so it's called after all other hooks
elgg_register_plugin_hook_handler('register', 'menu:topbar', 'modify_topbar_menu', 1000);
function modify_topbar_menu($hook, $type, $return, $params) {
$remove = ['friends'];
foreach ($return as $key => $item) {
/* @var $item \ElggMenuItem */
if (in_array($item->getName(), $remove) {
unset($return[$key]);
continue;
}
switch ($item->getName()) {
case 'profile' :
$item->setText('Profile');
$item->setPriority(200);
break;
}
$return[$key] = $item;
}
return $return;
}
It's a one-time setup thing, probably just as easy to disable it via admin isn't it?
@Matt Beckett The problem with disabling it via admin is that I sometimes forget to disable it after a fresh install, then when I encounter some problem and then spend some time debugging and finally found that I need to disable this theme. Therefore, could there be a better approach for the developer or user to choose a theme, for example in a config file like some other framework?
In your custom theme you can set aalborg as a conflicting plugin with the manifest.xml. That will mean you *can't* enable your theme until aalborg is disabled. Then you'll never forget.
I don't think it's worth the effort. And it's likely a lot of effort necessary to successfully hide usage of Elgg sufficiently. And even if it's less apparent that Elgg is used, it would help as an attack would most likely not be directed against Elgg usage in the first place specifically but rather aim undirectedly against any possible framework installed. If the attack would be successful, it wouldn't matter if the framework in use would be camouflaged because the sucess of the attack would reveal it anyway.
And putting effort into hiding which framework is used would require constant work every time you update your site to take into account any changes in code of the new version. And you would want to use the latest version as soon as possible as they might fix some security issue that you are so afraid of.
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.