MDL-64821 output: add wrapping class for ratings label

Add a span tag with a class that wraps the ratings label and popup
link so that it can be styled.
This commit is contained in:
Ryan Wyllie 2019-09-03 09:54:10 +08:00
parent e81be9a8b1
commit 4dd2570dd7

View File

@ -2241,6 +2241,7 @@ class core_renderer extends renderer_base {
if ($rating->user_can_view_aggregate()) {
$aggregatelabel = $ratingmanager->get_aggregate_label($rating->settings->aggregationmethod);
$aggregatelabel = html_writer::tag('span', $aggregatelabel, array('class'=>'rating-aggregate-label'));
$aggregatestr = $rating->get_aggregate_string();
$aggregatehtml = html_writer::tag('span', $aggregatestr, array('id' => 'ratingaggregate'.$rating->itemid, 'class' => 'ratingaggregate')).' ';
@ -2251,17 +2252,16 @@ class core_renderer extends renderer_base {
}
$aggregatehtml .= html_writer::tag('span', $countstr, array('id'=>"ratingcount{$rating->itemid}", 'class' => 'ratingcount')).' ';
$ratinghtml .= html_writer::tag('span', $aggregatelabel, array('class'=>'rating-aggregate-label'));
if ($rating->settings->permissions->viewall && $rating->settings->pluginpermissions->viewall) {
$nonpopuplink = $rating->get_view_ratings_url();
$popuplink = $rating->get_view_ratings_url(true);
$action = new popup_action('click', $popuplink, 'ratings', array('height' => 400, 'width' => 600));
$ratinghtml .= $this->action_link($nonpopuplink, $aggregatehtml, $action);
} else {
$ratinghtml .= $aggregatehtml;
$aggregatehtml = $this->action_link($nonpopuplink, $aggregatehtml, $action);
}
$ratinghtml .= html_writer::tag('span', $aggregatelabel . $aggregatehtml, array('class' => 'rating-aggregate-container'));
}
$formstart = null;