sidebar in frontpage only for admin

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Gareth J Barnard
Re: sidebar in frontpage only for admin
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Dear edu g,

Mary is correct in saying about deleting code as that will only lead to maintainability issues - there are far better less sledge hammer solutions to this:

1. Use and set the 'My Moodle' page for users - - no code changes needed.

2. There is a function 'is_siteadmin()' with the $USER global - e.g. if (is_siteadmin($USER)) - I believe that it is not totally recommended and may not be supported in future, but it currently exists.  It does have a replacement but I'd have to look that up.  However, this should get you going.



Average of ratings: -