Which your Elgg version?
Elgg 2.3
The code you mentioned should work.
I assume your custom plugin is not located at the bottom on the Plugins page.
Or you didn't clean the caches.
You can also try overriding this view instead:
Copy from \mod\search\views\default\search\header.php to \mod\my_plugin\views\default\search\header.php
Edit this file:
<?php
if (!elgg_is_admin_logged_in()) {
return;
}
echo elgg_view('search/search_box', array('class' => 'elgg-search-header'));
Flush the caches is required.
You can use this skeleton plugin for your customizations.
If you mean that people can see a listing of the directories. Than you may have an error in your .htaccess.
It should be disabled: see https://github.com/Elgg/Elgg/blob/1598cc34dfec71bff969563c2c7b070e616bb2a5/install/config/htaccess.dist#L6-L7
Indeed. Fixed now. Thanks.
I tried it, but unfortunately it does not fix the problem. Do I need to edit any file in files plugin ?
Just tested it and this plugin works very well as is without any modifications.
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.