protected function print_badge_endorsement(badge $badge) {
        $output = '';
        $endorsement = $badge->get_endorsement();
        $dl = array();
        $output .= $this->heading(get_string('endorsement', 'badges'), 3);
        if (!empty($endorsement)) {
            $dl[get_string('issuername', 'badges')] = $endorsement->issuername;
            $dl[get_string('issueremail', 'badges')] =
                html_writer::tag('a', $endorsement->issueremail, array('href' => 'mailto:' . $endorsement->issueremail));
            $dl[get_string('issuerurl', 'badges')] = html_writer::link($endorsement->issuerurl, $endorsement->issuerurl,
                array('target' => '_blank'));
            $dl[get_string('dateawarded', 'badges')] = userdate($endorsement->dateissued);
            $dl[get_string('claimid', 'badges')] = html_writer::link($endorsement->claimid, $endorsement->claimid,
            array('target' => '_blank'));
            $dl[get_string('claimcomment', 'badges')] = $endorsement->claimcomment;
            $output .= $this->definition_list($dl);
        } else {
            $output .= get_string('noendorsement', 'badges');
        }
        return $output;
    }