Skip to content

Instantly share code, notes, and snippets.

@sela
Created April 4, 2016 12:40
Show Gist options
  • Save sela/803b5da87a8903dcb074dee48e129e17 to your computer and use it in GitHub Desktop.
Save sela/803b5da87a8903dcb074dee48e129e17 to your computer and use it in GitHub Desktop.
protected function render_custom_menu(custom_menu $menu) {
global $USER;
// If the menu has no children return an empty string
if (!$menu->has_children()) {
return '';
}
if (isloggedin()){
$useremail=$USER->email;
// acording to the email address we detect if the user is the teacher and similar to moodle 1 enable or disable the button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment