diff --git a/question/bank/deletequestion/classes/delete_action.php b/question/bank/deletequestion/classes/delete_action.php index b98ad9cb528..de5568f2cd8 100644 --- a/question/bank/deletequestion/classes/delete_action.php +++ b/question/bank/deletequestion/classes/delete_action.php @@ -72,7 +72,7 @@ class delete_action extends question_action_base { } public function get_menu_position(): int { - return 400; + return 2000; } protected function get_url_icon_and_label(\stdClass $question): array { @@ -99,4 +99,18 @@ class delete_action extends question_action_base { return [$url, 't/delete', $this->strdelete]; } } + + /** + * Override method to get url and label for delete action to add the text-danger class. + * + * @param \stdClass $question + * @return \action_menu_link|null + */ + public function get_action_menu_link(\stdClass $question): ?\action_menu_link { + $deletelink = parent::get_action_menu_link($question); + if ($deletelink !== null) { + $deletelink->add_class('text-danger'); + } + return $deletelink; + } } diff --git a/question/classes/local/bank/view_component.php b/question/classes/local/bank/view_component.php index 486c92c1641..81b750ca48a 100644 --- a/question/classes/local/bank/view_component.php +++ b/question/classes/local/bank/view_component.php @@ -55,9 +55,9 @@ abstract class view_component { * 200 edit_action * 250 copy_action * 300 tags_action - * 400 delete_action * 500 history_action * 600 export_xml_action + * 2000 delete_action * (So, if you want your action at a particular place in the order, there should be space.) * * If two actions get the same order number, then the tie-break on the sort