mirror of
https://github.com/moodle/moodle.git
synced 2025-04-25 02:16:06 +02:00
MDL-54164 notification: Add notification render to CLI renderer
This commit is contained in:
parent
ccf323d571
commit
073fcb5aa1
lib
@ -157,6 +157,24 @@ class notification implements \renderable, \templatable {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message for this notification.
|
||||
*
|
||||
* @return string message
|
||||
*/
|
||||
public function get_message() {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message type for this notification.
|
||||
*
|
||||
* @return string message type
|
||||
*/
|
||||
public function get_message_type() {
|
||||
return $this->messagetype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export this data so it can be used as the context for a mustache template.
|
||||
*
|
||||
|
@ -4372,6 +4372,17 @@ class core_renderer_cli extends core_renderer {
|
||||
* footer method to prevent the default footer.
|
||||
*/
|
||||
public function footer() {}
|
||||
|
||||
/**
|
||||
* Render a notification (that is, a status message about something that has
|
||||
* just happened).
|
||||
*
|
||||
* @param \core\output\notification $notification the notification to print out
|
||||
* @return string plain text output
|
||||
*/
|
||||
public function render_notification(\core\output\notification $notification) {
|
||||
return $this->notification($notification->get_message(), $notification->get_message_type());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user