mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Old fixes for printing tag cloud I didn't checkin
This commit is contained in:
parent
1d45238e36
commit
0495bd9124
1 changed files with 10 additions and 4 deletions
14
tag/lib.php
14
tag/lib.php
|
@ -1437,7 +1437,7 @@ function print_tag_search_results($query, $page, $perpage) {
|
||||||
* @param int $max_size maximum text size, in percentage
|
* @param int $max_size maximum text size, in percentage
|
||||||
* @param int $min_size minimum text size, in percentage
|
* @param int $min_size minimum text size, in percentage
|
||||||
*/
|
*/
|
||||||
function print_tag_cloud($tagcloud, $shuffle=true, $max_size=180, $min_size=80) {
|
function print_tag_cloud($tagcloud, $shuffle=true, $max_size=180, $min_size=80, $return=false) {
|
||||||
|
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
|
@ -1475,7 +1475,7 @@ function print_tag_cloud($tagcloud, $shuffle=true, $max_size=180, $min_size=80)
|
||||||
$can_manage_tags = has_capability('moodle/tag:manage', $systemcontext);
|
$can_manage_tags = has_capability('moodle/tag:manage', $systemcontext);
|
||||||
|
|
||||||
//prints the tag cloud
|
//prints the tag cloud
|
||||||
echo '<ul id="tag-cloud-list">';
|
$output = '<ul id="tag-cloud-list">';
|
||||||
foreach ($tagcloud as $key => $tag) {
|
foreach ($tagcloud as $key => $tag) {
|
||||||
|
|
||||||
$size = $min_size + ((log10($tag->count) - $min) * $step);
|
$size = $min_size + ((log10($tag->count) - $min) * $step);
|
||||||
|
@ -1493,10 +1493,16 @@ function print_tag_cloud($tagcloud, $shuffle=true, $max_size=180, $min_size=80)
|
||||||
|
|
||||||
$tag_link = '<li><a '.$href.' '.$title.' '. $style .'>'.$tagname.'</a></li> ';
|
$tag_link = '<li><a '.$href.' '.$title.' '. $style .'>'.$tagname.'</a></li> ';
|
||||||
|
|
||||||
echo $tag_link;
|
$output .= $tag_link;
|
||||||
|
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
$output .= '</ul>';
|
||||||
|
|
||||||
|
if ($return) {
|
||||||
|
return $output;
|
||||||
|
} else {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue