summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-04-17 12:20:50 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-04-17 12:20:50 -0400
commitc769a33392c4dedbabfb1fa1fda5c8bb30b84c78 (patch)
tree1b7eb92c38710057197b08c0f04912417d13d0b6 /IkiWiki/Plugin
parentc6c03768da90df0d7474edce09c2abf2a7e32052 (diff)
autoindex: Switch to using %wikistate instead of abusing $pagestate{index}.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/autoindex.pm20
1 files changed, 14 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm
index 555856b11..c71d73349 100644
--- a/IkiWiki/Plugin/autoindex.pm
+++ b/IkiWiki/Plugin/autoindex.pm
@@ -61,8 +61,16 @@ sub refresh () {
}
my %deleted;
- if (ref $pagestate{index}{autoindex}{deleted}) {
- %deleted=%{$pagestate{index}{autoindex}{deleted}};
+ if (ref $wikistate{autoindex}{deleted}) {
+ %deleted=%{$wikistate{autoindex}{deleted}};
+ }
+ elsif (ref $pagestate{index}{autoindex}{deleted}) {
+ # compatability code
+ %deleted=%{$pagestate{index}{autoindex}{deleted}};
+ delete $pagestate{index}{autoindex};
+ }
+
+ if (keys %deleted) {
foreach my $dir (keys %deleted) {
# remove deleted page state if the deleted page is re-added,
# or if all its subpages are deleted
@@ -71,7 +79,7 @@ sub refresh () {
delete $deleted{$dir};
}
}
- $pagestate{index}{autoindex}{deleted}=\%deleted;
+ $wikistate{autoindex}{deleted}=\%deleted;
}
my @needed;
@@ -82,10 +90,10 @@ sub refresh () {
# This page must have just been deleted, so
# don't re-add it. And remember it was
# deleted.
- if (! ref $pagestate{index}{autoindex}{deleted}) {
- $pagestate{index}{autoindex}{deleted}={};
+ if (! ref $wikistate{autoindex}{deleted}) {
+ $wikistate{autoindex}{deleted}={};
}
- ${$pagestate{index}{autoindex}{deleted}}{$dir}=1;
+ ${$wikistate{autoindex}{deleted}}{$dir}=1;
}
else {
push @needed, $dir;