Hi all
A simple question: can a block hide itself using code, and if so how?
The context is that I'm writing a block to add/hide content sections, and only want it to be visible in edit mode. So something like:
if ($PAGE->user_is_editing()) {
// show me
}
else {
// hide me
}
I've had a hunt in this forum, Moodle Docs and a Famous Internet Search Engine [TM], and can find lots on hiding blocks in the UI but nothing on code to do so. I suspect that it's not possible, in which case no big deal, I'll just display the block empty in non-editing mode.
Fred