Base class to make it easier to implement actions that are menuable_actions.
Copyright: | 2019 Tim Hunt |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 77 lines (3 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
question_action_base:: (2 methods):
get_url_icon_and_label()
get_action_menu_link()
Class: question_action_base - X-Ref
Base class to make it easier to implement actions that are menuable_actions.get_url_icon_and_label(\stdClass $question) X-Ref |
Get the information required to display this action either as a menu item or a separate action column. For most actions, it should be sufficient to override just this method. {@see get_action_menu_link()} is the public interface and handles building a renderable menu link object from this data. If this action cannot apply to this question (e.g. because the user does not have permission, then return [null, null, null]. param: \stdClass $question the row from the $question table, augmented with extra information. return: array with three elements. |
get_action_menu_link(\stdClass $question) X-Ref |
Return the action menu link for this action on the supplied question. For most actions, you will just need to override {@see get_url_icon_and_label()}. You only need to override this method if you need to pass additional attributes to {@see action_menu_link_secondary}, or use a different class to render the link. param: \stdClass $question return: \action_menu_link|null |