X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9747c47670064f206189eb3c36a8e7fcfe08e172..b3f7c6a9a579208f555a9ae7a409474d68897d04:/IkiWiki/Plugin/pagestats.pm

diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index 4313aa271..17b26f7ba 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -27,6 +27,7 @@ sub getsetup () {
 		plugin => {
 			safe => 1,
 			rebuild => undef,
+			section => "widget",
 		},
 }
 
@@ -74,7 +75,7 @@ sub preprocess (@) {
 	}
 
 	if ($style eq 'table') {
-		return "<table class='pageStats'>\n".
+		return "<table class='".(exists $params{class} ? $params{class} : "pageStats")."'>\n".
 			join("\n", map {
 				"<tr><td>".
 				htmllink($params{page}, $params{destpage}, $_, noimageinline => 1).
@@ -86,16 +87,31 @@ sub preprocess (@) {
 	else {
 		# In case of misspelling, default to a page cloud
 
-		my $res = "<div class='pagecloud'>\n";
+		my $res;
+		if ($style eq 'list') {
+			$res = "<ul class='".(exists $params{class} ? $params{class} : "list")."'>\n";
+		}
+		else {
+			$res = "<div class='".(exists $params{class} ? $params{class} : "pagecloud")."'>\n";
+		}
 		foreach my $page (sort keys %counts) {
 			next unless $counts{$page} > 0;
 
 			my $class = $classes[$counts{$page} * scalar(@classes) / ($max + 1)];
+			
+			$res.="<li>" if $style eq 'list';
 			$res .= "<span class=\"$class\">".
 			        htmllink($params{page}, $params{destpage}, $page).
 			        "</span>\n";
+			$res.="</li>" if $style eq 'list';
+
+		}
+		if ($style eq 'list') {
+			$res .= "</ul>\n";
+		}
+		else {
+			$res .= "</div>\n";
 		}
-		$res .= "</div>\n";
 
 		return $res;
 	}