Moodle 2.0.
Further to my report MDL-26074 I have found a way to achieve the feature I wanted in my block_glossary_export_to_quiz. Here is a description of the needed feature:
When the block is displayed, if there are no glossaries available in the current course, and Edit mode is ON, I do not want the Configuration icon to be displayed at the top of my block. I only want the other 3 icons there: Roles, Hide, Delete and Move.
To implement this feature, I copy function get_content_for_output from moodleblocks.class.php and override it by adding a condition thus:
$numglossaries = $DB->count_records('glossary', array('course' => $this->course->id));
$bc->controls = $this->page->blocks->edit_controls($this);
if (!$numglossaries) {
unset ($bc->controls[2]);
}
}
This gives me exactly the functionality I want. However, the comments for function get_content_for_output in moodleblocks.class.php say:
You probably should not override this method, but instead override {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()}, {@link hide_header()}, {@link (get_edit_controls)}, etc.
I would like to just do that, but a function get_edit_controls() is nowhere to be found in moodleblocks.class.php. Where is that function? How can I over-ride it in my block's block_glossary_export_to_quiz.php file?
What does {@link} mean in moodle comments?
When the comments say you probably should not override this method,, what are the risks in doing it?
I do not understand the second $this in $bc->controls = $this->page->blocks->edit_controls($this); It looks strange to me.
TIA for any help and please excuse an amateur programmer's naive questions.
Joseph