protected function render_workshop_message(workshop_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 workshop_message::TYPE_OK:
            $sty = 'ok';
            break;
        case workshop_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));
    }
protected function render_workshop_message(workshop_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 workshop_message::TYPE_OK:
            $sty = 'ok';
            break;
        case workshop_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));
    }
protected function render_workshop_message ( workshop_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 workshop_message :: TYPE_OK : $ sty = 'ok' ; break ; case workshop_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 ) ) ; }
Renders workshop message

@param workshop_message $message to display
@return string html code
Renders workshop message