mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-48477 questions: no delete icon for only top-level category
The back end code already threw an exception if you clicked the icon, so you could not delete the category, but we should not have shown the icon in the first place. Thanks to Pramith Dayananda for working out the fix for this issue. I am just committing it.
This commit is contained in:
parent
da0ef2e4cf
commit
6403c8d39b
@ -113,7 +113,7 @@ class question_category_list_item extends list_item {
|
||||
array('context' => $this->parentlist->context, 'noclean' => true));
|
||||
|
||||
// don't allow delete if this is the last category in this context.
|
||||
if (count($this->parentlist->records) != 1) {
|
||||
if (!question_is_only_toplevel_category_in_context($category->id)) {
|
||||
$deleteurl = new moodle_url($this->parentlist->pageurl, array('delete' => $this->id, 'sesskey' => sesskey()));
|
||||
$item .= html_writer::link($deleteurl,
|
||||
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/delete'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user