safe => 1,
rebuild => 1,
},
+ discussionpage => {
+ type => "string",
+ default => gettext("Discussion"),
+ description => "name of Discussion pages",
+ safe => 1,
+ rebuild => 1,
+ },
sslcookie => {
type => "boolean",
default => 0,
return;
}
+my %pagename_cache;
+
sub pagename ($) {
my $file=shift;
+ if (exists $pagename_cache{$file}) {
+ return $pagename_cache{$file};
+ }
+
my $type=pagetype($file);
my $page=$file;
$page=~s/\Q.$type\E*$//
if ($config{indexpages} && $page=~/(.*)\/index$/) {
$page=$1;
}
+
+ $pagename_cache{$file} = $page;
return $page;
}
);
};
if ($@) {
- chomp $@;
+ my $error=$@;
+ chomp $error;
$ret="[[!$command <span class=\"error\">".
- gettext("Error").": $@"."</span>]]";
+ gettext("Error").": $error"."</span>]]";
}
}
else {
$links{$page}=$d->{links};
$oldlinks{$page}=[@{$d->{links}}];
}
- if (exists $d->{depends}) {
- $depends{$page}=$d->{depends};
+ if (exists $d->{dependslist}) {
+ $depends{$page}={
+ map { $_ => 1 } @{$d->{dependslist}}
+ };
+ }
+ elsif (exists $d->{depends}) {
+ $depends{$page}={$d->{depends} => 1};
}
if (exists $d->{state}) {
$pagestate{$page}=$d->{state};
};
if (exists $depends{$page}) {
- $index{page}{$src}{depends} = $depends{$page};
+ $index{page}{$src}{dependslist} = [ keys %{$depends{$page}} ];
}
if (exists $pagestate{$page}) {
sub add_depends ($$) {
my $page=shift;
my $pagespec=shift;
-
- return unless pagespec_valid($pagespec);
- if (! exists $depends{$page}) {
- $depends{$page}=$pagespec;
- }
- else {
- $depends{$page}=pagespec_merge($depends{$page}, $pagespec);
- }
+ return unless pagespec_valid($pagespec);
+ $depends{$page}{$pagespec} = 1;
return 1;
}
unless grep { $_ eq $link } @{$links{$page}};
}
-sub pagespec_merge ($$) {
- my $a=shift;
- my $b=shift;
-
- return $a if $a eq $b;
- return "($a) or ($b)";
-}
-
sub pagespec_translate ($) {
my $spec=shift;
}
}
else {
- return IkiWiki::FailReason->new("$testpage has no ctime");
+ return IkiWiki::ErrorReason->new("$testpage does not exist");
}
}
}
}
else {
- return IkiWiki::FailReason->new("$testpage has no ctime");
+ return IkiWiki::ErrorReason->new("$testpage does not exist");
}
}