gjb2048 / moodle-theme_essential

The Essential Moodle Theme
https://gjb2048.github.io/moodle-theme_essential/
GNU General Public License v3.0
91 stars 120 forks source link

Context menu in header near top right empty and showing for non-logged in users and students #876

Closed syedmahtab closed 5 years ago

syedmahtab commented 6 years ago

May you live in peace!

This is related to $plugin->release = '3.3.1.4 (Build: 2017040308)'; If a user is not logged in or logged in as student, a cog icon menu near top right appears which does not has any items in it and should not be there. The same menu is populated with context sensitive items when logged in as admin / manager / teacher. It appears that the same should not appear for non-logged in users and students etc.

To correct the issue, I changed following line in context_header_settings_menu() method in /theme/essential/classes/output/core_renderer.php file: if ((($showfrontpagemenu) || ($showcoursemenu) || ($showusermenu))) { return $this->render_navbar_action_menu($menu, $title); } else { return ''; } To: if ((($showfrontpagemenu) || ($showcoursemenu) || ($showusermenu)) && $menu->is_empty() != 1) { return $this->render_navbar_action_menu($menu, $title); } else { return ''; }

Please look into the issue and update if the solutions is correct? Warm regards, Mahtab Hussain

gjb2048 commented 6 years ago

Thanks for the information Mahtab. I'll need time to test. Is it a problem on M3.4+? Peace :).

gjb2048 commented 5 years ago

Cannot replicate but concept is a good one and worth doing.

gjb2048 commented 5 years ago

M3.5 -> https://moodle.org/mod/forum/discuss.php?d=379017