Wondering how to replace Isteacher() in that case

Re: Wondering how to replace Isteacher() in that case

by Arnaud Saint-Georges -
Number of replies: 0
Bonjour Frédéric,

Have you looked at this excellent documentation:
http://docs.moodle.org/en/Development:Roles#Programming_Interface

For example, you may use something like that:
$context = get_context_instance(CONTEXT_SYSTEM))
if (has_capability('moodle/legacy:admin', $context)||has_capability('moodle/legacy:teacher', $context)) {

 }
Hope this helps?

Arnaud