Skip to content

Commit

Permalink
Merge branch 'MDL-54164-integration-cli-fix' of git://github.com/ryan…
Browse files Browse the repository at this point in the history
…wyllie/moodle
  • Loading branch information
David Monllao committed May 18, 2016
2 parents 60e75de + 073fcb5 commit 6b6847b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/classes/output/notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,24 @@ public function set_extra_classes($classes = array()) {
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.
*
Expand Down
11 changes: 11 additions & 0 deletions lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4372,6 +4372,17 @@ public function notification($message, $type = null) {
* 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());
}
}


Expand Down

0 comments on commit 6b6847b

Please sign in to comment.