Exemple #1
0
 /**
  * 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());
 }
Exemple #2
0
    /**
     * 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 the HTML to output.
     */
    protected function render_notification(\core\output\notification $notification) {

        $data = $notification->export_for_template($this);

        $templatename = '';
        switch($data->type) {
            case \core\output\notification::NOTIFY_MESSAGE:
                $templatename = 'core/notification_message';
                break;
            case \core\output\notification::NOTIFY_SUCCESS:
                $templatename = 'core/notification_success';
                break;
            case \core\output\notification::NOTIFY_PROBLEM:
                $templatename = 'core/notification_problem';
                break;
            case \core\output\notification::NOTIFY_REDIRECT:
                $templatename = 'core/notification_redirect';
                break;
            default:
                $templatename = 'core/notification_message';
                break;
        }

        return self::render_from_template($templatename, $data);

    }
Exemple #3
0
 /**
  * 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 the HTML to output.
  */
 protected function render_notification(\core\output\notification $notification)
 {
     return $this->render_from_template($notification->get_template_name(), $notification->export_for_template($this));
 }