/** * Renders teamwork message * * @param teamwork_message $message to display * @return string html code */ protected function render_teamwork_message(teamwork_message $message) { $text = $message->get_message(); $url = $message->get_action_url(); $label = $message->get_action_label(); if (empty($text) and empty($label)) { return ''; } switch ($message->get_type()) { case teamwork_message::TYPE_OK: $sty = 'ok'; break; case teamwork_message::TYPE_ERROR: $sty = 'error'; break; default: $sty = 'info'; } $o = html_writer::tag('span', $message->get_message()); if (!is_null($url) and !is_null($label)) { $o .= $this->output->single_button($url, $label, 'get'); } return $this->output->container($o, array('message', $sty)); }