| 1 |
wakaba |
1.1 |
use strict; |
| 2 |
|
|
package SuikaWiki::Plugin::Registry; |
| 3 |
|
|
|
| 4 |
|
|
|
| 5 |
|
|
our %Info; |
| 6 |
|
|
$Info{q#Map#}->{Name} = q#Map#; |
| 7 |
hero |
1.1.2.1 |
$Info{q#Map#}->{q#Version#} = q#2005.0121.1412#; |
| 8 |
wakaba |
1.1 |
$Info{q#Map#}->{q#InterfaceVersion#} = q#2.9.1#; |
| 9 |
hero |
1.1.2.1 |
$Info{q#Map#}->{q#mkpluginVersion#} = q#2.1.21#; |
| 10 |
|
|
$Info{q#Map#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::Map1050021141203qjsz#; |
| 11 |
|
|
$Info{q#Map#}->{q#Date.RCS#} = q#$Date: 2004/09/21 03:18:22 $#; |
| 12 |
wakaba |
1.1 |
$Info{q#Map#}->{RequiredPlugin} = [q#Search#, q#WikiLinking#, q#WikiNamespace#]; |
| 13 |
|
|
$Info{q#Map#}->{Description} = [[q#Visualization of page to page relatinships#, q#en#, q##]]; |
| 14 |
|
|
$Info{q#Map#}->{License} = [[q#%%Perl%%#, q##, q##]]; |
| 15 |
|
|
$Info{q#Map#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#[email protected]#]], [q##]]]; |
| 16 |
hero |
1.1.2.1 |
package SuikaWiki::Plugin::plugin::Map1050021141203qjsz; |
| 17 |
wakaba |
1.1 |
|
| 18 |
|
|
|
| 19 |
|
|
#line 1 "(WikiPlugin module source map.wp2, block Plugin/Use)" |
| 20 |
|
|
use Message::Util::Error; |
| 21 |
|
|
my $WIKILINKING; |
| 22 |
|
|
my $WIKIRESOURCE; |
| 23 |
|
|
#line 1 "(WikiPlugin module Map, chunk 1)" |
| 24 |
|
|
|
| 25 |
|
|
$SuikaWiki::Plugin::Rule{view}->{m__wikipage_obsolete} = {q#Parameter#, {q#page#, {q#Type#, q#WikiName#, q#Default#, q#(current)#, q#Description#, [[q#The WikiPage that might be obsoleted.#, q#en#, q##]]}, q#desc_before#, {q#Type#, q#template#, q#Default#, q#(none)#, q#Description#, [[q#The description should be located before WikiPage names if any.#, q#en#, q##]]}, q#desc_after#, {q#Type#, q#template#, q#Default#, q#(none)#, q#Description#, [[q#The description should be located after WikiPage names if any.#, q#en#, q##]]}}, q#Description#, [[q#The navigation notify that this WikiPage is obsolete and |
| 26 |
|
|
should refer the other WikiPages.#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 27 |
|
|
|
| 28 |
|
|
#line 1 "(WikiPlugin module source map.wp2, block FormattingRule[name()='[q#view#]/m__wikipage_obsolete']/Formatting)" |
| 29 |
|
|
my $page = $o->{wiki}->name ($p->{page} || $o->{wiki}->{var}->{page}); |
| 30 |
|
|
my $content_prop; |
| 31 |
|
|
try { |
| 32 |
|
|
$content_prop = $o->{wiki}->{db}->get (content_prop => $page); |
| 33 |
|
|
} catch SuikaWiki::DB::Util::Error with { |
| 34 |
|
|
my $err = shift; |
| 35 |
|
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
| 36 |
|
|
} catch SuikaWiki::Format::Definition::error with { |
| 37 |
|
|
}; |
| 38 |
|
|
if ($content_prop) { |
| 39 |
|
|
my $obs = $content_prop->get_attribute_value |
| 40 |
|
|
(q#http://suika.fam.cx/~wakaba/archive/2004/7/20/sw\#obsolete#, as_array => 1, |
| 41 |
|
|
default => []); |
| 42 |
|
|
if (@$obs) { |
| 43 |
|
|
my $pp = $p->{-parent}->append_new_node |
| 44 |
|
|
(type => '#element', |
| 45 |
|
|
namespace_uri => q#http://www.w3.org/1999/xhtml#, |
| 46 |
|
|
local_name => 'p'); |
| 47 |
|
|
$pp->set_attribute (class => 'm--wikipage-obsolete'); |
| 48 |
|
|
$f->parse_attr ($p=>q#desc_before#, $o, -parent => $pp, -non_parsed_to_node => 1, %opt); |
| 49 |
|
|
my $i = 0; |
| 50 |
|
|
for (@$obs) { |
| 51 |
|
|
$pp->append_text (', ') if $i++; |
| 52 |
|
|
($SuikaWiki::Plugin::Registry::Info{q#WikiLinking#}->{module_name} || SuikaWiki::Plugin->module_package (q#WikiLinking#))->to_wikipage_in_html ( |
| 53 |
|
|
{ |
| 54 |
|
|
} => { |
| 55 |
|
|
base => $page, |
| 56 |
|
|
page_name_relative => $o->{wiki}->name ($_), |
| 57 |
|
|
}, { |
| 58 |
|
|
o => $o, |
| 59 |
|
|
parent => $pp, |
| 60 |
|
|
}); |
| 61 |
|
|
} |
| 62 |
|
|
$f->parse_attr ($p=>q#desc_after#, $o, -parent => $pp, -non_parsed_to_node => 1, %opt); |
| 63 |
|
|
} |
| 64 |
|
|
}}} |
| 65 |
|
|
#line 1 "(WikiPlugin module Map, chunk 2)" |
| 66 |
|
|
; |
| 67 |
|
|
|
| 68 |
|
|
$SuikaWiki::Plugin::Rule{view}->{m__html_link_navigation} = {q#Parameter#, {q#page#, {q#Type#, q#WikiName#, q#Default#, q#(current)#, q#Description#, [[q#Target WikiPage#, q#en#, q##]]}}, q#Description#, [[q#Navigation links (HTML link elements) made from content properties#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 69 |
|
|
|
| 70 |
|
|
#line 1 "(WikiPlugin module source map.wp2, block FormattingRule[name()='[q#view#]/m__html_link_navigation']/Formatting)" |
| 71 |
|
|
my $page = $o->{wiki}->name ($p->{page} || $o->{wiki}->{var}->{page}); |
| 72 |
|
|
my $content_prop; |
| 73 |
|
|
try { |
| 74 |
|
|
$content_prop = $o->{wiki}->{db}->get (content_prop => $page); |
| 75 |
|
|
} catch SuikaWiki::DB::Util::Error with { |
| 76 |
|
|
my $err = shift; |
| 77 |
|
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
| 78 |
|
|
} catch SuikaWiki::Format::Definition::error with { |
| 79 |
|
|
}; |
| 80 |
|
|
if ($content_prop) { |
| 81 |
|
|
for my $rel ( |
| 82 |
|
|
{uri => q#http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev\#prev#, html => 'prev'}, |
| 83 |
|
|
{uri => q#http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev\#next#, html => 'next'}, |
| 84 |
|
|
{uri => q#http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev\#contents#, html => 'contents'}, |
| 85 |
|
|
{uri => q#http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev\#index#, html => 'index'}, |
| 86 |
|
|
{uri => q#http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev\#up#, html => 'up'}, |
| 87 |
|
|
) { |
| 88 |
|
|
if (my $val = $content_prop->get_attribute ($rel->{uri})) { |
| 89 |
|
|
$val = $val->value; |
| 90 |
|
|
for (ref $val eq 'ARRAY' ? @$val : $val) { |
| 91 |
|
|
($SuikaWiki::Plugin::Registry::Info{q#WikiLinking#}->{module_name} || SuikaWiki::Plugin->module_package (q#WikiLinking#))->to_wikipage_in_html ( |
| 92 |
|
|
{ |
| 93 |
|
|
label => qq(%html-link ( |
| 94 |
|
|
description => {%res (name => {Map:LinkNav:$rel->{html}:Description});: %page-name;: %page-headline;}p, |
| 95 |
|
|
);\n), |
| 96 |
|
|
} => { |
| 97 |
|
|
base => $page, |
| 98 |
|
|
page_name_relative => $o->{wiki}->name ($_), |
| 99 |
|
|
}, { |
| 100 |
|
|
o => $o, |
| 101 |
|
|
parent => $p->{-parent}, |
| 102 |
|
|
-rel => $rel->{html}, |
| 103 |
|
|
}); |
| 104 |
|
|
} |
| 105 |
|
|
} |
| 106 |
|
|
} |
| 107 |
|
|
}}} |
| 108 |
|
|
#line 1 "(WikiPlugin module Map, chunk 4)" |
| 109 |
|
|
; |
| 110 |
|
|
|
| 111 |
|
|
{my $def = {q#Parameter#, {q#ns#, {q#Type#, q#WikiName#, q#Default#, q#(auto)#, q#Description#, [[q#WikiNamespace name to which listed WikiPages belong#, q#en#, q##]]}}, q#Description#, [[q#Recently changed WikiPage list#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 112 |
|
|
|
| 113 |
|
|
#line 1 "(WikiPlugin module source map.wp2, block FormattingRule[name()='[q#form-input#, q#view#, q#view-resource#]/recent_change_list']/Formatting)" |
| 114 |
|
|
my $list = $p->{-parent}->append_new_node |
| 115 |
|
|
(type => '#element', |
| 116 |
|
|
namespace_uri => q#http://www.w3.org/1999/xhtml#, |
| 117 |
|
|
local_name => 'ol'); |
| 118 |
|
|
$list->set_attribute (class => 'm--recent-changes'); |
| 119 |
|
|
$p->{q#ns#} = do { my $r = $f->parse_attr ($p=>q#ns#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};$p->{q#recursive#} = do { my $r = $f->parse_attr ($p=>q#recursive#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 120 |
|
|
$p->{recursive} = 1 unless length $p->{recursive}; |
| 121 |
|
|
my $ns = $o->{wiki}->name ($p->{ns}); |
| 122 |
|
|
my @target = map { try { [$_, $o->{wiki}->{db}->get (lastmodified => $_)] } |
| 123 |
|
|
catch SuikaWiki::DB::Util::Error with { |
| 124 |
|
|
my $err = shift; |
| 125 |
|
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
| 126 |
|
|
[$_, undef]} } |
| 127 |
|
|
$o->{wiki}->{db}->keys ('lastmodified', |
| 128 |
|
|
-ns => $ns, |
| 129 |
|
|
-type => 'key', |
| 130 |
|
|
-recursive => $p->{recursive}); |
| 131 |
|
|
try { |
| 132 |
|
|
my $nsmodified = $o->{wiki}->{db}->get (lastmodified => $ns); |
| 133 |
|
|
push @target, [$ns, $nsmodified] if $nsmodified; |
| 134 |
|
|
} catch SuikaWiki::DB::Util::Error with { |
| 135 |
|
|
my $err = shift; |
| 136 |
|
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
| 137 |
|
|
}; |
| 138 |
|
|
@target = sort {$b->[1] <=> $a->[1]} @target; |
| 139 |
|
|
$p->{q#start#} = do { my $r = $f->parse_attr ($p=>q#start#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 140 |
|
|
$p->{q#n#} = do { my $r = $f->parse_attr ($p=>q#n#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 141 |
|
|
my $start = length $p->{start} ? $p->{start} : |
| 142 |
|
|
$o->{wiki}->{input}->parameter ('m--change--range-start') || 0; |
| 143 |
|
|
$p->{n} = $o->{wiki}->{input}->parameter ('m--change--range-number') |
| 144 |
|
|
unless length $p->{n}; |
| 145 |
|
|
my $end = $p->{n} ? $start + $p->{n} - 1 : $start + 29; |
| 146 |
|
|
$start = 0 if $start > $#target or $start < 0; |
| 147 |
|
|
$end = $#target if $end < $start or $end > $#target; |
| 148 |
|
|
$end = $start + 255 if $end > $start + 255; |
| 149 |
|
|
local $o->{var}->{search__result} = { |
| 150 |
|
|
min => 0, |
| 151 |
|
|
max => $#target, |
| 152 |
|
|
start => $start, |
| 153 |
|
|
end => $end, |
| 154 |
|
|
number => $p->{n} || 30, |
| 155 |
|
|
query => $p->{query}, |
| 156 |
|
|
param_prefix => 'm--change', |
| 157 |
|
|
}; |
| 158 |
|
|
$p->{q#template#} = do { my $r = $f->parse_attr ($p=>q#template#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 159 |
|
|
$p->{template} ||= ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get |
| 160 |
|
|
(name => 'Link:toWikiPage:SourceLabelLong:RecentChangeItem', |
| 161 |
|
|
wiki => $o->{wiki}, o => $o); |
| 162 |
|
|
$p->{q#mode#} = do { my $r = $f->parse_attr ($p=>q#mode#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 163 |
|
|
for my $target (@target[$start..$end]) { |
| 164 |
|
|
($WIKILINKING ||= SuikaWiki::Plugin->module_package ('WikiLinking'))->to_wikipage_in_html ({ |
| 165 |
|
|
label => $p->{template}, |
| 166 |
|
|
} => { |
| 167 |
|
|
base => $o->{wiki}->{var}->{page}, |
| 168 |
|
|
page_name_relative => $o->{wiki}->name ($target->[0]), |
| 169 |
|
|
wiki_mode => $p->{mode}, |
| 170 |
|
|
_with_lm => 1, |
| 171 |
|
|
page_lastmodified => $target->[1], |
| 172 |
|
|
}, { |
| 173 |
|
|
o => $o, |
| 174 |
|
|
parent => $list->append_new_node |
| 175 |
|
|
(type => '#element', |
| 176 |
|
|
namespace_uri => q#http://www.w3.org/1999/xhtml#, |
| 177 |
|
|
local_name => 'li'), |
| 178 |
|
|
}); |
| 179 |
|
|
} |
| 180 |
|
|
if ($list->count) { |
| 181 |
|
|
$list->set_attribute (start => $start + 1); |
| 182 |
|
|
$f->parse_attr ($p=>q#post_list#, $o, -parent => $p->{-parent}, -non_parsed_to_node => 1, %opt); |
| 183 |
|
|
} else { |
| 184 |
|
|
$p->{-parent}->remove_child_node ($list); |
| 185 |
|
|
}}} |
| 186 |
|
|
#line 1 "(WikiPlugin module Map, chunk 6)" |
| 187 |
|
|
; |
| 188 |
|
|
$SuikaWiki::Plugin::Rule{form_input}->{recent_change_list} = $def; |
| 189 |
|
|
$SuikaWiki::Plugin::Rule{view}->{recent_change_list} = $def; |
| 190 |
|
|
$SuikaWiki::Plugin::Rule{view_resource}->{recent_change_list} = $def; |
| 191 |
|
|
}; |
| 192 |
|
|
|
| 193 |
|
|
push @SuikaWiki::View::Implementation::CommonViewDefs, { |
| 194 |
|
|
condition => {q#mode#, q#m__change#, q#http_method#, [q#GET#, q#HEAD#, q#POST#]}, |
| 195 |
hero |
1.1.2.1 |
object_class => q#SuikaWiki::Plugin::plugin::Map1050021141203qjsz::m__change1050021141203CQvC#, |
| 196 |
wakaba |
1.1 |
}; |
| 197 |
hero |
1.1.2.1 |
package SuikaWiki::Plugin::plugin::Map1050021141203qjsz::m__change1050021141203CQvC; |
| 198 |
wakaba |
1.1 |
|
| 199 |
|
|
|
| 200 |
|
|
our @ISA = q#SuikaWiki::View::template#; |
| 201 |
|
|
|
| 202 |
|
|
sub main ($$$) { |
| 203 |
|
|
my ($self, $opt, $opt2) = @_; |
| 204 |
|
|
require SuikaWiki::Output::HTTP; |
| 205 |
|
|
$opt2->{output} = SuikaWiki::Output::HTTP->new |
| 206 |
|
|
(wiki => $self->{view}->{wiki}, |
| 207 |
|
|
view => $self->{view}, viewobj => $self); |
| 208 |
|
|
for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}}, |
| 209 |
|
|
'Accept-Language') { |
| 210 |
|
|
$opt2->{output}->add_negotiate_header_field ($_); |
| 211 |
|
|
} |
| 212 |
|
|
|
| 213 |
|
|
$opt2->{template} = q#%html-document ( |
| 214 |
|
|
title => {%res (name => {Map:Change:WebPageTitle});}p, |
| 215 |
|
|
link-meta => {%template (name => links);}p, |
| 216 |
|
|
content => { |
| 217 |
|
|
%block ( |
| 218 |
|
|
id => tools1, class => tools, |
| 219 |
|
|
content => {%template (name => navbar);}p, |
| 220 |
|
|
); |
| 221 |
|
|
%section ( |
| 222 |
|
|
title => {%res (name => {Map:Change:Title});}p, |
| 223 |
|
|
heading, |
| 224 |
|
|
id => WEBPAGE--M--CHANGE, |
| 225 |
|
|
content => {%recent-change-list ( |
| 226 |
|
|
n => 50, |
| 227 |
|
|
ns => {%page-name;}p, |
| 228 |
|
|
post-list => {%search--result-navigation ( |
| 229 |
|
|
fragment => WEBPAGE--M--CHANGE, |
| 230 |
|
|
);}p, |
| 231 |
|
|
);}p, |
| 232 |
|
|
); |
| 233 |
|
|
%block ( |
| 234 |
|
|
id => footer, |
| 235 |
|
|
content => {%template (name => ws--footer);}p, |
| 236 |
|
|
); |
| 237 |
|
|
}p, |
| 238 |
|
|
);#; |
| 239 |
|
|
$opt2->{o} = bless { |
| 240 |
|
|
## SuikaWiki 3 WikiPlugin interface |
| 241 |
|
|
wiki => $self->{view}->{wiki}, |
| 242 |
|
|
plugin => $self->{view}->{wiki}->{plugin}, |
| 243 |
|
|
var => {}, |
| 244 |
|
|
}, 'SuikaWiki::Plugin'; |
| 245 |
|
|
$opt2->{output}->{status_code} = 200; |
| 246 |
|
|
|
| 247 |
|
|
$opt2->{output}->{entity}->{media_type} = q#text/html#; |
| 248 |
|
|
|
| 249 |
|
|
$opt2->{output}->{entity}->{charset} = $self->{view}->{wiki}->{config}->{charset}->{output}; |
| 250 |
|
|
$opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#list#}}); |
| 251 |
|
|
$opt2->{output}->{entity}->{body_is_octet_stream} = 0; |
| 252 |
|
|
|
| 253 |
|
|
$self->{view}->{wiki}->init_db; |
| 254 |
|
|
$self->main_pre ($opt, $opt2); |
| 255 |
|
|
|
| 256 |
|
|
require Message::Markup::XML::Serialize::HTML; |
| 257 |
|
|
use Message::Util::Error; |
| 258 |
|
|
try { |
| 259 |
|
|
$opt2->{output}->{entity}->{body} |
| 260 |
|
|
= Message::Markup::XML::Serialize::HTML::html_simple |
| 261 |
|
|
(SuikaWiki::Plugin->formatter ('view') |
| 262 |
|
|
->replace ($opt2->{template}, param => $opt2->{o})); |
| 263 |
|
|
} $self->{view}->{wiki}->{config}->{catch}->{ formatter_view }; |
| 264 |
|
|
$opt2->{output}->output (output => 'http-cgi'); |
| 265 |
|
|
|
| 266 |
|
|
$self->main_post ($opt, $opt2); |
| 267 |
|
|
} |
| 268 |
|
|
|
| 269 |
hero |
1.1.2.1 |
package SuikaWiki::Plugin::plugin::Map1050021141203qjsz; |
| 270 |
wakaba |
1.1 |
|
| 271 |
|
|
{my $def = {q#Parameter#, {q#ns#, {q#Type#, q#WikiName#, q#Default#, q#(auto)#, q#Description#, [[q#WikiNamespace name to which listed WikiPages belong#, q#en#, q##]]}}, q#Description#, [[q#WikiPage list#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 272 |
|
|
|
| 273 |
|
|
#line 1 "(WikiPlugin module source map.wp2, block FormattingRule[name()='[q#form-input#, q#view#, q#view-resource#]/page_list']/Formatting)" |
| 274 |
|
|
my $list = $p->{-parent}->append_new_node |
| 275 |
|
|
(type => '#element', |
| 276 |
|
|
namespace_uri => q#http://www.w3.org/1999/xhtml#, |
| 277 |
|
|
local_name => 'ul'); |
| 278 |
|
|
$p->{q#ns#} = do { my $r = $f->parse_attr ($p=>q#ns#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};$p->{q#recursive#} = do { my $r = $f->parse_attr ($p=>q#recursive#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 279 |
|
|
$p->{recursive} = 1 unless length $p->{recursive}; |
| 280 |
|
|
my $ns = $o->{wiki}->name ($p->{ns}); |
| 281 |
|
|
my @target = sort {$a->[1] cmp $b->[1]} |
| 282 |
|
|
map {[$_, join "\t", @{$_}]} # make sort key |
| 283 |
|
|
$o->{wiki}->{db}->keys ('content', |
| 284 |
|
|
-ns => $ns, |
| 285 |
|
|
-type => 'key', |
| 286 |
|
|
-recursive => $p->{recursive}); |
| 287 |
|
|
$p->{q#start#} = do { my $r = $f->parse_attr ($p=>q#start#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 288 |
|
|
$p->{q#n#} = do { my $r = $f->parse_attr ($p=>q#n#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 289 |
|
|
my $start = length $p->{start} ? $p->{start} : |
| 290 |
|
|
$o->{wiki}->{input}->parameter ('m--list--range-start') || 0; |
| 291 |
|
|
$p->{n} = $o->{wiki}->{input}->parameter ('m--list--range-number') |
| 292 |
|
|
unless length $p->{n}; |
| 293 |
|
|
my $end = $p->{n} ? $start + $p->{n} - 1 : $start + 29; |
| 294 |
|
|
$start = 0 if $start > $#target or $start < 0; |
| 295 |
|
|
$end = $#target if $end < $start or $end > $#target; |
| 296 |
|
|
$end = $start + 255 if $end > $start + 255; |
| 297 |
|
|
local $o->{var}->{search__result} = { |
| 298 |
|
|
min => 0, |
| 299 |
|
|
max => $#target, |
| 300 |
|
|
start => $start, |
| 301 |
|
|
end => $end, |
| 302 |
|
|
number => $p->{n} || 30, |
| 303 |
|
|
query => $p->{query}, |
| 304 |
|
|
param_prefix => 'm--list', |
| 305 |
|
|
}; |
| 306 |
|
|
$p->{q#template#} = do { my $r = $f->parse_attr ($p=>q#template#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 307 |
|
|
$p->{template} ||= ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get |
| 308 |
|
|
(name => 'Link:toWikiPage:SourceLabelLong:PageList', |
| 309 |
|
|
wiki => $o->{wiki}, o => $o); |
| 310 |
|
|
$p->{q#mode#} = do { my $r = $f->parse_attr ($p=>q#mode#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r}; |
| 311 |
|
|
try { |
| 312 |
|
|
for (@target[$start..$end]) { |
| 313 |
|
|
($WIKILINKING ||= SuikaWiki::Plugin->module_package ('WikiLinking'))->to_wikipage_in_html ({ |
| 314 |
|
|
label => $p->{template}, |
| 315 |
|
|
} => { |
| 316 |
|
|
base => $o->{wiki}->{var}->{page}, |
| 317 |
|
|
page_name_relative => $o->{wiki}->name ($_->[0]), |
| 318 |
|
|
wiki_mode => $p->{mode}, |
| 319 |
|
|
}, { |
| 320 |
|
|
o => $o, |
| 321 |
|
|
parent => $list->append_new_node |
| 322 |
|
|
(type => '#element', |
| 323 |
|
|
namespace_uri => q#http://www.w3.org/1999/xhtml#, |
| 324 |
|
|
local_name => 'li'), |
| 325 |
|
|
}); |
| 326 |
|
|
} |
| 327 |
|
|
} catch SuikaWiki::DB::Util::Error with { |
| 328 |
|
|
my $err = shift; |
| 329 |
|
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
| 330 |
|
|
}; |
| 331 |
|
|
if ($list->count) { |
| 332 |
|
|
$list->set_attribute (start => $start + 1); |
| 333 |
|
|
$f->parse_attr ($p=>q#post_list#, $o, -parent => $p->{-parent}, -non_parsed_to_node => 1, %opt); |
| 334 |
|
|
} else { |
| 335 |
|
|
$p->{-parent}->remove_child_node ($list); |
| 336 |
|
|
}}} |
| 337 |
|
|
#line 1 "(WikiPlugin module Map, chunk 8)" |
| 338 |
|
|
; |
| 339 |
|
|
$SuikaWiki::Plugin::Rule{form_input}->{page_list} = $def; |
| 340 |
|
|
$SuikaWiki::Plugin::Rule{view}->{page_list} = $def; |
| 341 |
|
|
$SuikaWiki::Plugin::Rule{view_resource}->{page_list} = $def; |
| 342 |
|
|
}; |
| 343 |
|
|
|
| 344 |
|
|
$SuikaWiki::Plugin::Rule{page_link}->{m__link_weight} = {q#Parameter#, {}, q#Description#, [], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 345 |
|
|
|
| 346 |
|
|
#line 1 "(WikiPlugin module source map.wp2, block FormattingRule[name()='[q#page-link#]/m__link_weight']/Formatting)" |
| 347 |
|
|
$p->{-parent}->append_text ($o->{link}->{option}->{-m__weight}+0);}} |
| 348 |
|
|
#line 1 "(WikiPlugin module Map, chunk 10)" |
| 349 |
|
|
; |
| 350 |
|
|
|
| 351 |
|
|
push @{$SuikaWiki::View::Implementation::TemplateFragment{q#ws__post_content#}}, { |
| 352 |
|
|
Main => q#%section ( |
| 353 |
|
|
id => children, |
| 354 |
|
|
title => {%res(name=>{Children:Title});}p, heading, |
| 355 |
|
|
content => {%page-list ( |
| 356 |
|
|
ns => {%page-name;}p, recursive => 0, |
| 357 |
|
|
type => both, |
| 358 |
|
|
template => {%resource-as-plain-text (name => {Children:Item});}p, |
| 359 |
|
|
post-list => {%search--result-navigation ( |
| 360 |
|
|
fragment => children, |
| 361 |
|
|
);}p, |
| 362 |
|
|
);}p, |
| 363 |
|
|
);#, |
| 364 |
|
|
Order => 100, |
| 365 |
|
|
Description => [[q#After content body -- children and backward links#, q#en#, q##]], |
| 366 |
|
|
}; |
| 367 |
|
|
|
| 368 |
|
|
push @{$SuikaWiki::View::Implementation::TemplateFragment{q#navbar#}}, { |
| 369 |
|
|
Main => q#%link-to-wikipage ( |
| 370 |
|
|
page => {%ns--root-wikiname;}p, |
| 371 |
|
|
mode => m--change, |
| 372 |
|
|
label => {%link-to-it ( |
| 373 |
|
|
label => {%res (name => GoToRecentChanges);}p, |
| 374 |
|
|
description => {%res (name => GoToRecentChangesLong);}p, |
| 375 |
|
|
);}, |
| 376 |
|
|
rel => news, |
| 377 |
|
|
); #, |
| 378 |
|
|
Order => 21, |
| 379 |
|
|
Description => [], |
| 380 |
|
|
}; |
| 381 |
|
|
|
| 382 |
|
|
push @{$SuikaWiki::View::Implementation::TemplateFragment{q#links#}}, { |
| 383 |
|
|
Main => q#%m--html-link-navigation; |
| 384 |
|
|
%link-to-wikipage ( |
| 385 |
|
|
page => {%ns--root-wikiname;}p, |
| 386 |
|
|
rel => news, |
| 387 |
|
|
mode => m--change, |
| 388 |
|
|
label => {%html-link ( |
| 389 |
|
|
description => {%res(name=>GoToRecentChangesLink);}p, |
| 390 |
|
|
);}, |
| 391 |
|
|
); |
| 392 |
|
|
%link-to-wikipage ( |
| 393 |
|
|
page => {%ns-page-path-name;}p, |
| 394 |
|
|
rel => news, |
| 395 |
|
|
mode => m--change, |
| 396 |
|
|
label => {%html-link ( |
| 397 |
|
|
description => {%res(name=> {Map:Change:Link:Parent:Description});}p, |
| 398 |
|
|
);}, |
| 399 |
|
|
); |
| 400 |
|
|
%link-to-wikipage ( |
| 401 |
|
|
rel => news, |
| 402 |
|
|
mode => m--change, |
| 403 |
|
|
label => {%html-link ( |
| 404 |
|
|
description => {%res(name=> {Map:Change:Link:Local:Description});}p, |
| 405 |
|
|
);}, |
| 406 |
|
|
); #, |
| 407 |
|
|
Order => 0, |
| 408 |
|
|
Description => [], |
| 409 |
|
|
}; |
| 410 |
|
|
|
| 411 |
|
|
package SuikaWiki::Plugin::Resource; |
| 412 |
|
|
|
| 413 |
|
|
our $BaseResource; |
| 414 |
|
|
$BaseResource->{q#und#}->{q##}->{q#Children:Title#} = q#%link-to-it(label=>{%ns-short-page-name;}p, description=>{%page-name(absolute);}p, ); %span(class=>headline, content=>{%page-headline;}p);#; |
| 415 |
|
|
$BaseResource->{q#und#}->{q##}->{q#Link:toWikiPage:SourceLabelLong:PageList#} = q#%link-to-it( label=>{%page-title(relative);}p, description=>{%page-name(absolute);}p, ); %span(class=>headline,content=>{%page-headline;}p);#; |
| 416 |
|
|
$BaseResource->{q#und#}->{q##}->{q#Link:toWikiPage:SourceLabelLong:RecentChangeItem#} = q#%last-modified; %link-to-it( label=>{%page-title(relative);}p, description=>{%page-name(absolute);}p, ); %span(class=>headline,content=>{%page-headline;}p);#; |
| 417 |
|
|
$BaseResource->{q#und#}->{q##}->{q#Link:toWikiPage:SourceLabelLong:SearchResult#} = q#{%m--link-weight;} %link-to-it( label=>{%page-title(relative);}p, description=>{%page-name(absolute);}p, ); %span(class=>headline,content=>{%page-headline;}p);#; |
| 418 |
|
|
$BaseResource->{q#en#}->{q##}->{q#GoToRecentChanges#} = q#Recent#; |
| 419 |
|
|
$BaseResource->{q#en#}->{q##}->{q#GoToRecentChangesLink#} = q#Recently modified WikiPages list#; |
| 420 |
|
|
$BaseResource->{q#en#}->{q##}->{q#GoToRecentChangesLong#} = q#Review recently modified WikiPages list#; |
| 421 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:Change:Link:Local:Description#} = q#List of recently modified WikiPages in this namespace (%page-name;)#; |
| 422 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:Change:Link:Parent:Description#} = q#List of recently modified WikiPages in parent namespace (%ns-page-path-name;)#; |
| 423 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:Change:Title#} = q#Recent Changes#; |
| 424 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:Change:WebPageTitle#} = q#Recent Changes (%page-name;)#; |
| 425 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:LinkNav:prev:Description#} = q#Previous WikiPage#; |
| 426 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:LinkNav:next:Description#} = q#Next WikiPage#; |
| 427 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:LinkNav:contents:Description#} = q#Table of Contents#; |
| 428 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:LinkNav:index:Description#} = q#Index#; |
| 429 |
|
|
$BaseResource->{q#en#}->{q##}->{q#Map:LinkNav:up:Description#} = q#Up#; |
| 430 |
|
|
package SuikaWiki::Plugin::Registry; |
| 431 |
|
|
|
| 432 |
|
|
$Info{q#Map#}->{provide} = {q#rule#, {q#form_input#, [q#recent_change_list#, q#page_list#], q#view#, [q#m__wikipage_obsolete#, q#m__html_link_navigation#, q#recent_change_list#, q#page_list#], q#view_resource#, [q#recent_change_list#, q#page_list#], q#page_link#, [q#m__link_weight#]}, q#viewfragment#, [{q#Name#, q#ws__post_content#}, {q#Name#, q#navbar#}, {q#Name#, q#links#}], q#viewdef#, [{q#Description#, [q#Show recently changed WikiPages list#, q#en#, q##], q#Name#, q#m__change#}]}; |
| 433 |
|
|
|
| 434 |
|
|
1; |