From 4dd2570dd795b67ea9b00312d1fe2987f6b280b1 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Tue, 3 Sep 2019 09:54:10 +0800 Subject: [PATCH] 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. --- lib/outputrenderers.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index fa0cc06b49e..88bf930e180 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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;