function data_print_ratings_mean($recordid, $scale, $link = true) { // Print the multiple ratings on a post given to the current user by others. // Scale is an array of ratings static $strrate; $mean = data_get_ratings_mean($recordid, $scale); if ($mean !== "") { if (empty($strratings)) { $strratings = get_string("ratings", "data"); } echo "{$strratings}: "; if ($link) { link_to_popup_window("/mod/data/report.php?id={$recordid}", "ratings", $mean, 400, 600); } else { echo "{$mean} "; } } }
/** * Print the multiple ratings on a post given to the current user by others. * Scale is an array of ratings * * @staticvar string $strrate * @param int $recordid * @param array $scale * @param bool $link */ function data_print_ratings_mean($recordid, $scale, $link = true) { global $OUTPUT; static $strrate; $mean = data_get_ratings_mean($recordid, $scale); if ($mean !== "") { if (empty($strratings)) { $strratings = get_string("ratings", "data"); } echo "{$strratings}: "; if ($link) { $link = html_link::make("/mod/data/report.php?id={$recordid}", $mean); $link->add_action(new popup_action('click', $link->url, 'ratings', array('height' => 400, 'width' => 600))); echo $OUTPUT->link($link); } else { echo "{$mean} "; } } }