Hi,
I'm currently working on a block for the university I work at, where we're trying to prompt our users to create courses to a basic standard, and one of the things that we would like to do is suggest that users add certain blocks to the page.
I'm getting a little unstuck when trying to query if certain blocks exist
$block_manager = new block_manager($PAGE);
$block_manager->load_blocks(true);
if($block_manager->is_block_present('name_of_block')) {
echo "Found";
} else {
echo "Not Found";
}
It seems that I'm querying an empty protected variable in the class, but I can't seem to figure out how to populate that variable.
Any help would be great!