diff options
author | intrigeri <intrigeri@boum.org> | 2010-06-25 14:38:37 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2010-06-25 14:38:37 +0200 |
commit | 9f401d6617a11efcedda1c956b2ccea061a7540f (patch) | |
tree | a5648589b38487427a58a7ebacfdc036a5dd102a /IkiWiki/Plugin/pagestats.pm | |
parent | 73f4a8835876c8cb07808367cd72d9ae972893e8 (diff) | |
parent | 71950b2ae5ff6fd3b631c5504455cc07699b1c11 (diff) | |
download | ikiwiki-9f401d6617a11efcedda1c956b2ccea061a7540f.tar ikiwiki-9f401d6617a11efcedda1c956b2ccea061a7540f.tar.gz |
Merge remote branch 'upstream/master' into prv/po
Conflicts:
IkiWiki/Plugin/po.pm
Diffstat (limited to 'IkiWiki/Plugin/pagestats.pm')
-rw-r--r-- | IkiWiki/Plugin/pagestats.pm | 22 |
1 files changed, 19 insertions, 3 deletions
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; } |