Look at this code.
Perhaps, you want to learn docs.
it didnot work for me can you try it ? it is very confusing i found this code :-
if you draw a 'widget' layout (like done in https://github.com/Elgg/Elgg/blob/a836dda6e17954f8825c728d69b6113e38a01332/mod/dashboard/views/default/resources/dashboard.php#L5-L11) the function 'elgg_can_edit_widget_layout()' is called which triggers a hook to allow users to add widgets when the function returns TRUE.
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.